Re: Primary key - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Primary key
Date
Msg-id 4D7E3AC3.7020602@iol.ie
Whole thread Raw
In response to Re: Primary key  (Allan Kamau <kamauallan@gmail.com>)
Responses Re: Primary key  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
On 14/03/2011 15:35, Allan Kamau wrote:

> CREATE SEQUENCE hy3_pack_seq MINVALUE 1000;
> CREATE TABLE hy3_pack
> (
> hy3_id INTEGER NOT NULL DEFAULT nextval('hy3_pack_seq') -- or hy3_id
> BIGINT NOT NULL DEFAULT nextval('hy3_pack_seq')

That's what SERIAL does for you, in one go - it's just syntactic sugar
for the above. Read all about it here:

http://www.postgresql.org/docs/9.0/static/datatype-numeric.html#DATATYPE-SERIAL


Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: Allan Kamau
Date:
Subject: Re: Primary key
Next
From: Raymond O'Donnell
Date:
Subject: Re: Primary key