Re: Primary key

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: rod(at)iol(dot)ie
Cc: Allan Kamau <kamauallan(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Primary key
Date: 2011-03-14 16:03:45
Message-ID: 4D7E3C61.9030409@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jo 2011-03-14 16:04:50 Re: Postgres 8.3 vs. 8.4 - Query plans and performance
Previous Message Raymond O'Donnell 2011-03-14 15:56:51 Re: Primary key