Re: CREATE TABLE initial value for PRIMARY KEY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Maurice Yarrow <yarrow(at)best(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TABLE initial value for PRIMARY KEY
Date: 2006-10-27 19:12:14
Message-ID: 8338.1161976334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Maurice Yarrow <yarrow(at)best(dot)com> writes:
> Is there a formal way to set an initial value for a PRIMARY KEY
> when CREATE TABLE ?

If it's a SERIAL column, you use setval() on the underlying sequence
before you start inserting data.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2006-10-27 19:15:59 Re: Mailing list problem?
Previous Message Dann Corbit 2006-10-27 19:10:03 Re: CREATE TABLE initial value for PRIMARY KEY