Re: effective SELECT from child tables

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: effective SELECT from child tables
Дата
Msg-id 87vf0fc4b1.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: effective SELECT from child tables  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> However, from a semantic point of view, it would be a bit strange. If
> you added a column, updated some rows then set a default, that default
> might end up applying to every row, except the ones you already
> modified. With careful coding you may be able to get around this.

I suppose the update would have to check for these new columns and fill in the
default value when first updated.

But what do you do if the DEFAULT expression isn't immutable. Volatile DEFAULT
expressions are extremely common in databases... namely sequences.

It's too bad though. An efficient way to add a new column with a default would
clear up one of the missing feature of Postgres. Virtually every time I add a
new column I have to do this ALTER TABLE, ALTER COLUMN SET DEFAULT, UPDATE
TABLE, VACUUM FULL, ALTER COLUMN SET NOT NULL dance. It would be real nice if
you could add a new NOT NULL column with a default with a single command and
just move on.

-- 
greg



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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Socket problem using beta2 on Windows-XP
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: External Sort timing debug statements