Re: effective SELECT from child tables

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: effective SELECT from child tables
Дата
Msg-id 87oe667yq0.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: effective SELECT from child tables  (Hannu Krosing <hannu@skype.net>)
Список pgsql-hackers
Hannu Krosing <hannu@skype.net> writes:

> Probably a different syntax would be better here, perhaps
> 
> ALTER TABLE ADD foo integer AS 1 WHEN MISSING;
>
> or somesuch.

Uhm, if you're adding the column they're *all* "missing". That's the whole
point. If you start inventing a new user-visible concept "missing" and try to
distinguish it from NULL you're going to have a hell of a time defining the
semantics.

The goal has to be to provide the *exact* same user-visible semantics as
actually setting the default. That means setting all the existing rows if
you're adding a new column.

It also unfortunately means tackling the much trickier gotcha that Tom raised
about what happens if you want to later change the default.

-- 
greg



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Build Farm: thrush
Следующее
От: Greg Stark
Дата:
Сообщение: Re: effective SELECT from child tables