Re: Serial data type not starting at 1

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
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:59:53
Message-ID: 20011115065900.B7025-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tielman J de Villiers 2001-11-15 15:02:54 Re: Serial data type not starting at 1
Previous Message Stephan Szabo 2001-11-15 14:58:27 Re: UPDATE w/ subselect doing locking