Re: Random not so random
Vivek Khera <khera@kcilink.com>
From: Vivek Khera <khera@kcilink.com>
To: pgsql-general@postgresql.org
Date: 2004-10-05T21:28:44Z
Lists: 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/