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

From Stephan Szabo
Subject Re: Serial data type not starting at 1
Date
Msg-id 20011115065900.B7025-100000@megazone23.bigpanda.com
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, 15 Nov 2001, 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 would think you can use setval() on the sequence created by the serial
before any rows are inserted in order to start at a different value.



pgsql-general by date:

Previous
From: Tielman J de Villiers
Date:
Subject: Re: Serial data type not starting at 1
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Serial data type not starting at 1