Re: feature request - adding columns with default value - Mailing list pgsql-general

From Tom Lane
Subject Re: feature request - adding columns with default value
Date
Msg-id 7078.1049471931@sss.pgh.pa.us
Whole thread Raw
In response to Re: feature request - adding columns with default value  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: feature request - adding columns with default value  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:
> SET DEFAULT just sets the default up but also doesn't modify the actual rows
> stored on disk.  Presumably SET DEFAULT should probably do the update,

No, it shouldn't; the existing behavior is per spec.  SET DEFAULT just
changes the default for future insertions, it's not supposed to touch
the present table contents.

ALTER TABLE ADD COLUMN with a default clause *is* supposed to fill all
rows of the table with the default.  The reason we reject it is we don't
have that behavior implemented.

            regards, tom lane


pgsql-general by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: Single Byte values
Next
From: Richard Huxton
Date:
Subject: Re: Meaning of .log_cnt?