Re: Re: Re: Re: RANDOM function? - Mailing list pgsql-novice

From Einar Karttunen
Subject Re: Re: Re: Re: RANDOM function?
Date
Msg-id Pine.LNX.4.33.0107311704430.20135-100000@melkinpaasi.cs.Helsinki.FI
Whole thread Raw
In response to Re: Re: Re: Re: RANDOM function?  (ghaverla@freenet.edmonton.ab.ca)
List pgsql-novice
On Tue, 31 Jul 2001 ghaverla@freenet.edmonton.ab.ca wrote:
>
> The only thing I would add, is your multiplier (2147...) must
> always be big, with respect to how many times you want to draw
> this random number without replacement.  If you were wanting
> to draw 2000000000 random numbers, this method would bog
> down in rejections (insert failures) towards the end.
>
You cannot go higher if you use an int column because it is a signed 32
bit integer. If you need more use bigints. They will suffice. If not
you are screwed anyways because oids don't suffice.

- Einar Karttunen


pgsql-novice by date:

Previous
From: Einar Karttunen
Date:
Subject: Re: Re: RANDOM function?
Next
From: Neal Lindsay
Date:
Subject: Dividing (and rounding) a date?