Re: Random not so random - Mailing list pgsql-general

From Vivek Khera
Subject Re: Random not so random
Date
Msg-id x7brfg6eib.fsf@yertle.int.kciLink.com
Whole thread Raw
In response to Re: Random not so random  ("Arnau Rebassa" <arebassa@hotmail.com>)
Responses Re: Random not so random  ("D. Stimits" <stimits@comcast.net>)
List pgsql-general
>>>>> "DS" == D Stimits <stimits@comcast.net> writes:

DS> If it uses the same seed from the connection, then all randoms within
DS> a connect that has not reconnected will use the same seed. Which means
DS> the same sequence will be generated each time, which is why it is
DS> pseudo-random and not random. For it to be random not just the first
DS> call of a new connection, but among all calls of new connection, it
DS> would have to seed it based on time at the moment of query and not at
DS> the moment of connect. A pseudo-random generator using the same seed
DS> will generate the same sequence.

You clearly demonstrate you do not understand the purpose of a seed in
a PRNG, nor how PRNG's in general work.  You want to seed it once and
only once per process, not every time you issue a query.  And nobody
said to use the same seed every time, either.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD  +1-301-869-4449 x806
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: SSL connection between PHP4 & PostgreSQL ???
Next
From: Tom Lane
Date:
Subject: Re: problem with pg_restore