On Mon, 4 Oct 2004, Bruno Wolff III wrote:
On Mon, Oct 04, 2004 at 18:58:41 +0200,
Marco Colombo <[EMAIL PROTECTED]> wrote:
Actually, that should be done each time the random() function
is evaluated. (I have no familiarity with the code, so please
That may be overkill, since I don't think that ran
On Thu, Oct 07, 2004 at 12:08:51 +0200,
Marco Colombo <[EMAIL PROTECTED]> wrote:
> On Wed, 6 Oct 2004, Bruno Wolff III wrote:
>
> >You don't necessarily need to break SHA1 to be able to track the internal
> >state.
>
> Well, I'm not an expert. I base my knowledge on what other people say.
> Quo
On Wed, 6 Oct 2004, Bruno Wolff III wrote:
I am going to keep this on general for now, since it seems like other people
might be interested even though it is straying a somewhat off topic.
Agreed.
Anyone who's not really interested on /dev/[u]random issues should
jump right to the last paragraphs o
On Tue, 5 Oct 2004, Tom Lane wrote:
now.tv_sec, and it's perfectly portable. No one in their right mind
expects random(3) to be cryptographically secure anyway, so doing more
doesn't seem warranted.
Tom, having a source of "real" random data isn't useful just for crypto
applications. No PRNG is pe
I am going to keep this on general for now, since it seems like other people
might be interested even though it is straying a somewhat off topic.
On Wed, Oct 06, 2004 at 18:02:39 +0200,
Marco Colombo <[EMAIL PROTECTED]> wrote:
>
> It depends. What's wrong with a SQL function taking long to
> co
On Tue, Oct 05, 2004 at 07:23:32AM -0600, Michael Fuhr wrote:
> On Tue, Oct 05, 2004 at 02:39:13PM +0200, Harald Fuchs wrote:
>
> > I think we don't need the randomness provided by /dev/[u]random. How
> > about XORing in getpid?
>
> What about making the seeding mechanism and perhaps random()'s
On Tue, Oct 05, 2004 at 11:27:05 +0200,
Marco Colombo <[EMAIL PROTECTED]> wrote:
> On Mon, 4 Oct 2004, Bruno Wolff III wrote:
>
> >You don't want to use /dev/random. You aren't going to get better random
> >numbers that way and blocking reads is a big problem.
>
> Sure you are. As far as the en
In article <[EMAIL PROTECTED]>,
"Dann Corbit" <[EMAIL PROTECTED]> writes:
> A better way would be to seed a Mersenne Twister PRNG at server startup
> time and then use the same generator for all subsequent calls.
> http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
> The period is exception
Vivek Khera wrote:
"DS" == D Stimits <[EMAIL PROTECTED]> 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-ran
> "DS" == D Stimits <[EMAIL PROTECTED]> 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 r
5, 2004 9:34 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [GENERAL] Random not so random
>
>
> A better way would be to seed a Mersenne Twister PRNG at
> server startup time and then use the same generator for all
> subsequent calls.
> http://w
age-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of D. Stimits
> Sent: Monday, October 04, 2004 7:23 AM
> Cc: [EMAIL PROTECTED]
> Subject: Re: [GENERAL] Random not so random
>
>
> Tom Lane wrote:
> > "Arnau Rebassa" <[EMAIL PROTECTED]>
Harald Fuchs <[EMAIL PROTECTED]> writes:
>> Tom Lane <[EMAIL PROTECTED]> wrote:
It might improve matters to make the code do something like
srandom((unsigned int) (now.tv_sec ^ now.tv_usec));
> I think we don't need the randomness provided by /dev/[u]random. How
> about XORing in getpid
On Tue, Oct 05, 2004 at 02:39:13PM +0200, Harald Fuchs wrote:
> I think we don't need the randomness provided by /dev/[u]random. How
> about XORing in getpid?
What about making the seeding mechanism and perhaps random()'s
behavior configurable?
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
In article <[EMAIL PROTECTED]>,
Bruno Wolff III <[EMAIL PROTECTED]> writes:
> On Mon, Oct 04, 2004 at 10:14:19 -0400,
> Tom Lane <[EMAIL PROTECTED]> wrote:
>>
>> It occurs to me that you might be seeing predictability as an indirect
>> result of something else you are doing that somehow tends t
"D. Stimits" <[EMAIL PROTECTED]> writes:
> Tom Lane wrote:
>> Hmm. postmaster.c does this during startup of each backend process:
>>
>> gettimeofday(&now, &tz);
>> srandom((unsigned int) now.tv_usec);
> If it uses the same seed from the connection, then all randoms within a
> connect that has n
Tom Lane wrote:
"Arnau Rebassa" <[EMAIL PROTECTED]> writes:
I'm using a debian linux as OS with a 2.4 kernel running on it.
Incidentally, are you reconnecting every time or is it that multiple calls
in a single session are returning the same record?
I'm reconnecting each time I want to retriev
On Mon, Oct 04, 2004 at 18:58:41 +0200,
Marco Colombo <[EMAIL PROTECTED]> wrote:
>
> Actually, that should be done each time the random() function
> is evaluated. (I have no familiarity with the code, so please
That may be overkill, since I don't think that random has been advertised
as a secur
On Mon, 4 Oct 2004, Tom Lane wrote:
"Arnau Rebassa" <[EMAIL PROTECTED]> writes:
I'm using a debian linux as OS with a 2.4 kernel running on it.
Incidentally, are you reconnecting every time or is it that multiple calls
in a single session are returning the same record?
I'm reconnecting each t
On Mon, Oct 04, 2004 at 10:14:19 -0400,
Tom Lane <[EMAIL PROTECTED]> 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
"Arnau Rebassa" <[EMAIL PROTECTED]> writes:
> I'm using a debian linux as OS with a 2.4 kernel running on it.
>> Incidentally, are you reconnecting every time or is it that multiple calls
>> in a single session are returning the same record?
> I'm reconnecting each time I want to retrieve a
Arnau Rebassa wrote:
I don't know if there is the possibility to seed the random number
generator manually, anybody knows it?
setseed()
-Neil
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
joi
Hi Greg,
What OS is this? Postgres is just using your OS's random()/srandom() calls.
On
some platforms these may be poorly implemented and not very random.
I'm using a debian linux as OS with a 2.4 kernel running on it.
Incidentally, are you reconnecting every time or is it that multiple calls
i
Hi everybody,
I'm doing the following query:
select * from messages order by random() limit 1;
in the table messages I have more than 200 messages and a lot of times,
the message retrieved is the same. Anybody knows how I could do a more
"random" random?
Thank you very much
--
Arnau
__
"Arnau Rebassa" <[EMAIL PROTECTED]> writes:
>select * from messages order by random() limit 1;
>
> in the table messages I have more than 200 messages and a lot of times, the
> message retrieved is the same. Anybody knows how I could do a more "random"
> random?
What OS is this? Postgres is
Use a SERIAL id on messages, then
Select * from messages
where id = int8( random() * currval({sequence_name}));
Arnau Rebassa wrote:
Hi everybody,
I'm doing the following query:
select * from messages order by random() limit 1;
in the table messages I have more than 200 messages and a lot of time
Hi everybody,
I'm doing the following query:
select * from messages order by random() limit 1;
in the table messages I have more than 200 messages and a lot of times, the
message retrieved is the same. Anybody knows how I could do a more "random"
random?
Thank you very much
--
Arnau
__
27 matches
Mail list logo