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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rod Taylor" <rbt(at)barchord(dot)com>
Cc: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected results
Date: 2001-07-16 19:02:13
Message-ID: 16628.995310133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"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"?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-07-16 19:42:14 Re: pg_depend
Previous Message alex avriette 2001-07-16 18:48:56 What I do with PostgreSQL