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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
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-16 21:18:13
Message-ID: 200107162118.f6GLIDM06466@candle.pha.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"?

Added to TODO.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Yap 2001-07-16 22:03:55 deferencing array of int8
Previous Message Nathan Myers 2001-07-16 21:04:32 Re: Re: SOMAXCONN (was Re: Solaris source code)