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

From hubert depesz lubaczewski
Subject Re: Create on insert a unique random number
Date
Msg-id 20080319095941.GB14712@depesz.com
Whole thread Raw
In response to Re: Create on insert a unique random number  ("Campbell, Lance" <lance@uiuc.edu>)
List pgsql-sql
On Tue, Mar 18, 2008 at 01:40:42PM -0500, Campbell, Lance wrote:
> This is not a security approach.  It is more about not giving obvious
> access to people that want to mess around.

1. keep primary key using standard serial. it will make your life a bit
simpler.
2. add column for text random identifiers (it doesn't have to be number,
and adding characters makes for much better "randomness").
3. check this:
http://www.depesz.com/index.php/2007/06/25/random-text-record-identifiers/

depesz

-- 
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump using SQL
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Create on insert a unique random number