From: autarch@urth.org
To: pgsql-bugs@postgresql.org
Subject: BUG #13195: ALTER TABLE with DEFAULT NULL is different than implicit default
Date: Wed, 29 Apr 2015 16:56:21 +0000
Message-ID: <20150429165621.2561.8175@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13195
Logged by: Dave Rolsky
Email address: autarch@urth.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: autarch@urth.org
Subject: Re: BUG #13195: ALTER TABLE with DEFAULT NULL is different than implicit default
In-Reply-To: <20150429165621.2561.8175@wrigleys.postgresql.org>
References: <20150429165621.2561.8175@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox