Re: Random not so random

From: Harald Fuchs <hf0722x(at)protecting(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Random not so random
Date: 2004-10-05 12:39:13
Message-ID: puzn31mj9q.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <20041004155742(dot)GA8488(at)wolff(dot)to>,
Bruno Wolff III <bruno(at)wolff(dot)to> writes:

> On Mon, Oct 04, 2004 at 10:14:19 -0400,
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> It occurs to me that you might be seeing predictability as an indirect
>> result of something else you are doing that somehow tends to synchronize
>> the backend start times. Are you connecting from a cron script that
>> would tend to be launched at the same relative instant within a second?
>>
>> It might improve matters to make the code do something like
>>
>> srandom((unsigned int) (now.tv_sec ^ now.tv_usec));

> Using /dev/urandom, where available, might be another option. However, some
> people may not want their entropy pool getting 4 bytes used up on every
> connection start up.

I think we don't need the randomness provided by /dev/[u]random. How
about XORing in getpid?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2004-10-05 13:06:16 Re: Function array_to_string(text[], text) does not exist ???
Previous Message Johann Robette 2004-10-05 10:07:11 Function array_to_string(text[], text) does not exist ???