Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)barchord(dot)com>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected results
Date: 2001-07-17 00:15:58
Message-ID: 3B5383BE.CA848BCA@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> "Rod Taylor" <rbt(at)barchord(dot)com> writes:
> > Running:
> > ALTER TABLE table ADD COLUMN column SERIAL;
> > Defines a column as int4 but does not create the sequence or attempt
> > to set the default value.
>
> Yeah ... SERIAL is implemented as a hack in the parsing of CREATE
> TABLE, but there's no corresponding hack in ALTER TABLE. A bug,
> no doubt about it, but I don't much like the obvious fix of duplicating
> the hack in two places. Isn't there a cleaner way to deal with this
> "data type"?
>

*ALTER TABLE* isn't as easy as *CREATE TABLE*.
It has another problem because it hasn't implemented
*DEFAULT* yet.

regards,
Hiroshi Inoue

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2001-07-17 00:55:42 Re: pg_depend
Previous Message Bill Studenmund 2001-07-16 23:29:58 Re: pg_depend