Re: Help with ADD COLUMN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Help with ADD COLUMN
Дата
Msg-id 26914.1038159339@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Help with ADD COLUMN  (Philip Warner <pjw@rhyme.com.au>)
Список 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 по дате отправления:

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Help with ADD COLUMN
Следующее
От: Bruce Momjian
Дата:
Сообщение: 7.3RC2 please