Re: effective SELECT from child tables - Mailing list pgsql-hackers

From Greg Stark
Subject Re: effective SELECT from child tables
Date
Msg-id 87oe667yq0.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: effective SELECT from child tables  (Hannu Krosing <hannu@skype.net>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Build Farm: thrush
Next
From: Greg Stark
Date:
Subject: Re: effective SELECT from child tables