Re: Serial data type not starting at 1

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tielman J de Villiers <tjdevil(at)bondnet(dot)co(dot)za>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Serial data type not starting at 1
Date: 2001-11-15 14:41:18
Message-ID: 20011116014118.B3148@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2001-11-15 14:43:19 Re: UPDATE w/ subselect doing locking
Previous Message tony 2001-11-15 14:40:37 Re: Serial data type not starting at 1