Re: Help with ADD COLUMN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Help with ADD COLUMN
Date
Msg-id 26914.1038159339@sss.pgh.pa.us
Whole thread Raw
In response to Re: Help with ADD COLUMN  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> At 03:48 PM 23/11/2002 -0800, Christopher Kings-Lynne wrote:
>> I assume that's the correct behaviour?  If they specify a default, the
>> column should be auto-filled with that default, right?

> Good question.

No, it's perfectly clear in the spec:
        1) The column defined by the <column definition> is added to T.
        2) Let C be the column added to T. Every value in C is the default           value for C.

The reason we currently reject DEFAULT in an ADD COLUMN is precisely
that the spec requires the semantics we don't have implemented.
(On the other hand, ALTER COLUMN SET DEFAULT is easy because it's not
supposed to affect existing table rows.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: Help with ADD COLUMN
Next
From: Bruce Momjian
Date:
Subject: 7.3RC2 please