Re: Create on insert a unique random number - Mailing list pgsql-sql

From Vivek Khera
Subject Re: Create on insert a unique random number
Date
Msg-id 6649C6F5-BEDE-4A66-A9A3-33CE95633A83@khera.org
Whole thread Raw
In response to Re: Create on insert a unique random number  ("Campbell, Lance" <lance@uiuc.edu>)
Responses Re: Create on insert a unique random number  ("Campbell, Lance" <lance@uiuc.edu>)
List pgsql-sql
On Mar 18, 2008, at 1:03 PM, Campbell, Lance wrote:

> The field n is not random but is sequential.  Is there something I
> should do to make the serial number random?

Depending on your "randomness" need, you can alter the increment of  
the sequence so it changes by a different amount than "1" on every  
increment, though it will still be constant increment.

You need to specify what the purpose of it being random is, then you  
might get more useful responses.  Does it need to be random for some  
security purpose?  If so, describe the level of security,  
specifically, against what threat are you defending?


pgsql-sql by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Create on insert a unique random number
Next
From: "A. Kretschmer"
Date:
Subject: Re: Create on insert a unique random number