Re: Newbie wonder...

From: Rod Taylor <pg(at)rbt(dot)ca>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, bernard(at)bgsoftfactory(dot)com
Subject: Re: Newbie wonder...
Date: 2005-03-14 13:56:22
Message-ID: 1110808582.1132.34.camel@home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 2005-03-14 at 10:02 +0100, PFC wrote:
> If you want to add a SERIAL field to an existing table, create a sequence
> and then create an integer field with default nextval(seq) and postgres
> will fill it automatically. The order in which it will fill it is not
> guaranteed though !

With 8.0, Alter Table supports most complicated commands including the
addition of SERIAL directly.

alter table abc add column bob serial NOT NULL UNIQUE;

--

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Lance Peterson 2005-03-14 17:31:20 Re: How to cast VARCHAR to BYTEA and vice-versa?
Previous Message Miroslav Šulc 2005-03-14 12:57:35 Re: lower and unicode