Re: Serial Column Tweaking

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Rickard <David(dot)Rickard(at)GTScompanies(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org, Judith Strawser <judiths(at)GTScompanies(dot)com>
Subject: Re: Serial Column Tweaking
Date: 2003-10-07 19:34:46
Message-ID: 20031007193446.GA14933@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Oct 07, 2003 at 12:25:23 -0700,
David Rickard <David(dot)Rickard(at)GTScompanies(dot)com> wrote:
> We're converting a database from Oracle to PostGreSQL (7.3.4); many of our
> tables have a sequential ID field as a prime key, populated in Oracle from
> sequences; we would like to make these fields serial data types in
> PostGreSQL (to simplify insert statements etc)--and we want to keep the ID
> values from the existing tables; is there a way to set a minimum value for
> the serial type? Or will we have to go to explicit sequences with defined
> minimum values?

When you use type serial a sequence is created. You can use setval to
set what value the sequence will give out next. Normally the associated
sequence name is tablename_columnname_seq .

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jeff Eckermann 2003-10-07 19:46:59 Re: perlsub
Previous Message David Rickard 2003-10-07 19:25:23 Serial Column Tweaking