Skip site navigation (1) Skip section navigation (2)

What algorithm does the random() function use?

From: Thomas Harold <thomas-news(at)nybeta(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: What algorithm does the random() function use?
Date: 2008-12-30 12:25:50
Message-ID: 495A134E.30209@nybeta.com (view raw or flat)
Thread:
Lists: pgsql-novice
So how good is the random() function in pgsql?  How many iterations 
through the PRNG before the PRNG loops?

Does it depend on the underlying O/S?  Which, in our case, is CentOS 5, 
64bit.

(I ask, because back in my Visual Basic days, I ran into an issue where 
the built-in PRNG would loop after 30 bits worth had been used.  Which 
caused issues in a situation where we really need a whole lot more 
length in our PRNG.)

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2008-12-30 15:44:53
Subject: Re: What algorithm does the random() function use?
Previous:From: Bruce HyattDate: 2008-12-25 20:00:24
Subject: Re: Fw: Re: connection refused

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group