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

Re: Create on insert a unique random number

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create on insert a unique random number
Date: 2008-03-18 16:51:39
Message-ID: 20080318165138.GA6578@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-sql
am  Tue, dem 18.03.2008, um  9:43:01 -0700 mailte chester c young folgendes:
> 
> > When inserting a record is there a way to have postgres create a
> > random number for a field such that it is unique?
> 
> 
> you could use oid

No! No oid, it's deprecated. The solution: use serial.


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

In response to

Responses

pgsql-sql by date

Next:From: Campbell, LanceDate: 2008-03-18 17:03:31
Subject: Re: Create on insert a unique random number
Previous:From: chester c youngDate: 2008-03-18 16:43:01
Subject: Re: Create on insert a unique random number

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