Thread: pgsql-server: Fix oversight in recent ALTER TABLE improvements.

pgsql-server: Fix oversight in recent ALTER TABLE improvements.

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Fix oversight in recent ALTER TABLE improvements.  We now support
ALTER TABLE tab ADD COLUMN col SERIAL, but we forgot to install the
dependency between the column and the sequence, so the sequence
would not go away if you dropped the table later.

Modified Files:
--------------
    pgsql-server/src/backend/commands:
        tablecmds.c (r1.113 -> r1.114)

(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/commands/tablecmds.c.diff?r1=1.113&r2=1.114)

Re: pgsql-server: Fix oversight in recent ALTER TABLE

From
Christopher Kings-Lynne
Date:
> Fix oversight in recent ALTER TABLE improvements.  We now support
> ALTER TABLE tab ADD COLUMN col SERIAL, but we forgot to install the
> dependency between the column and the sequence, so the sequence
> would not go away if you dropped the table later.

What if you ALTER TABLE / TYPE SERIAL?

Chris


Re: pgsql-server: Fix oversight in recent ALTER TABLE

From
Tom Lane
Date:
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> Fix oversight in recent ALTER TABLE improvements.  We now support
>> ALTER TABLE tab ADD COLUMN col SERIAL, but we forgot to install the
>> dependency between the column and the sequence, so the sequence
>> would not go away if you dropped the table later.

> What if you ALTER TABLE / TYPE SERIAL?

You can't --- it won't recognize the SERIAL alias in that context.

            regards, tom lane