Re: Serial data type not starting at 1 - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Serial data type not starting at 1
Date
Msg-id 20011116014118.B3148@svana.org
Whole thread Raw
In response to Serial data type not starting at 1  (Tielman J de Villiers <tjdevil@bondnet.co.za>)
List pgsql-general
On Thu, Nov 15, 2001 at 03:50:29PM +0200, Tielman J de Villiers wrote:
> Hi,
>
> I hope someone can help me.
>
> I want to create a new table using the "automatic" sequence function of
> Postgres by creating the first column as type "serial". But I want to start
> at say "5000". Can it be done, and how?

I don't think you can do it within the table definition, but you can
certainly use setval() to change the value after the table has been created.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Serial data type not starting at 1
Next
From: Vivek Khera
Date:
Subject: Re: Modifying check constraints