Re: feature request - adding columns with default value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Henrik Steffen <steffen(at)city-map(dot)de>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: feature request - adding columns with default value
Date: 2003-04-04 15:58:51
Message-ID: 7078.1049471931@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2003-04-04 16:09:22 Re: [PERFORM] OSS database needed for testing
Previous Message Tom Lane 2003-04-04 15:47:28 Re: unable to dump database, toast errors