pgsql: Avoid promising that "ADD COLUMN ... DEFAULT NULL" is free.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid promising that "ADD COLUMN ... DEFAULT NULL" is free.
Date: 2014-04-03 16:38:09
Message-ID: E1WVkeX-0006qm-5C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid promising that "ADD COLUMN ... DEFAULT NULL" is free.

The system realizes that DEFAULT NULL is dummy in simple cases, but not if
a cast function (such as a length coercion) needs to be applied. It's
dubious that suppressing that function call would be appropriate, anyway.
For the moment, let's just adjust the docs to say that you should omit the
DEFAULT clause if you don't want a rewrite to happen. Per gripe from Amit
Langote.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/879808e5197c374e431e81fb5599dfea533bb9aa

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-04-03 18:19:19 pgsql: Fix documentation about joining pg_locks to other views.
Previous Message Tom Lane 2014-04-03 15:06:58 pgsql: Fix documentation about size of interval type.