BUG #13195: ALTER TABLE with DEFAULT NULL is different than implicit default

From: autarch(at)urth(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13195: ALTER TABLE with DEFAULT NULL is different than implicit default
Date: 2015-04-29 16:56:21
Message-ID: 20150429165621.2561.8175@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13195
Logged by: Dave Rolsky
Email address: autarch(at)urth(dot)org
PostgreSQL version: 9.2.10
Operating system: Linux
Description:

If I have a very large table (or set of partitioned tables) and run "ALTER
TABLE foo ADD COLUMN bar text DEFAULT NULL", Pg takes several hours to
complete this statement. If I simply remove the "DEFAULT NULL" clause, I
will get what seems to be the exact same outcome in a fraction of a second.

Ideally, the "DEFAULT NULL" would be optimized away. But maybe the two
statements really are different in some way I can't see, in which case it'd
be great if Pg could detect this case and warn that this will take forever
with a suggestion that you can drop the "DEFAULT NULL (see X
documentation)."

Cheers,

-dave

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2015-04-29 17:07:11 Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Previous Message David G. Johnston 2015-04-29 16:04:03 Re: BUG #13188: .pgpass does not work