Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected
Дата
Msg-id Pine.LNX.4.30.0111281502350.636-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected results  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: ALTER TABLE ADD COLUMN column SERIAL -- unexpected  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian writes:

>         o ALTER TABLE ADD COLUMN column SET DEFAULT should fill existing
>           rows with DEFAULT value or allow NULLs in existing rows
>
> My guess is that we will have to do spec behavior by default, and add a
> flag to allow NULLs in existing rows.

May I point you to the already existing set of commands that do exactly
what you want:

ALTER TABLE t1 ADD COLUMN name type;
ALTER TABLE t1 ALTER COLUMN name SET DEFAULT foo;

There's no reason to muck around with the spec here.

-- 
Peter Eisentraut   peter_e@gmx.net



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: FW: [ppa-dev] Severe bug in debian - phppgadmin opens
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: CVS branch management (was Re: A problem with new