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