Re: Primary key - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Primary key
Date
Msg-id 4D7E3C61.9030409@iol.ie
Whole thread Raw
In response to Re: Primary key  (Raymond O'Donnell <rod@iol.ie>)
Responses Re: Primary key
List pgsql-general
On 14/03/2011 15:56, Raymond O'Donnell wrote:
> 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.

....with the exception of the MINVALUE bit, of course... :-)

Ray.

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

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Primary key
Next
From: Jo
Date:
Subject: Re: Postgres 8.3 vs. 8.4 - Query plans and performance