Re: Range of Serial values

From: "Poul L(dot) Christiansen" <poulc(at)cs(dot)auc(dot)dk>
To: cbell <cbell(at)lighthouseasp(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Range of Serial values
Date: 2001-04-16 16:06:44
Message-ID: 3ADB1894.21BF68A2@cs.auc.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Yes, there is.

When you create a serial column a sequence is created, which does the
counting.

You can create a serial column, drop the associated sequence and create
a new one with the command:
"CREATE SEQUENCE seqname START 1000".

See also "\h CREATE SEQUENCE".

HTH,
Poul L. Christansen

cbell wrote:
>
> Hello everyone,
>
> when creating a serial column, is there a way to specify which number it
> will start counting from? For example, if you wanted all Serial ID's to
> start at 1000 and count up from there, with no numbers below that.
>
> Thanks,
> Chris.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Roberto Mello 2001-04-16 16:31:49 Re: Using Random Sequence as Key
Previous Message Justin Clift 2001-04-16 15:42:01 Re: Range of Serial values