Re: feature request - adding columns with default value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: feature request - adding columns with default value
Дата
Msg-id 7078.1049471931@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: feature request - adding columns with default value  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: feature request - adding columns with default value  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> SET DEFAULT just sets the default up but also doesn't modify the actual rows
> stored on disk.  Presumably SET DEFAULT should probably do the update,

No, it shouldn't; the existing behavior is per spec.  SET DEFAULT just
changes the default for future insertions, it's not supposed to touch
the present table contents.

ALTER TABLE ADD COLUMN with a default clause *is* supposed to fill all
rows of the table with the default.  The reason we reject it is we don't
have that behavior implemented.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: Single Byte values
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Meaning of .log_cnt?