Re: [COMMITTERS] pgsql: Remove arbitrary ALTER TABLE .. ADD COLUMN restriction. - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: [COMMITTERS] pgsql: Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.
Date
Msg-id 4D401B2D0200002500039D4C@gw.wicourts.gov
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> wrote:
> If you really want to do what you seem to want (i.e. add a column
> with a default and not have it alter existing rows), you can
> already do it like this:
> 
> ALTER TABLE foo ADD COLUMN bar INTEGER, ALTER COLUMN bar SET
> DEFAULT 5;
> 
> If there's an intention to improve ALTER TABLE so that it
> propagates the new default to existing tuples in other tables, I
> have no problem with it throwing an error now.  Perhaps suggest
> the above syntax in a hint or something.
+1
I haven't reviewed the standard in this regard (always a painful
experience), but I believe Tom.  The behavior suggested by Robert
would surprise *me*, at least.
-Kevin


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.
Next
From: Simon Riggs
Date:
Subject: Re: SSI patch version 14