Fwd: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL - Mailing list pgsql-docs

From Amit Langote
Subject Fwd: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL
Date
Msg-id CA+HiwqHyY6fKuGjHTtF_HesnbJs=muu9chmNqzoa3MLaRv_KbQ@mail.gmail.com
Whole thread Raw
Responses Re: Fwd: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
---------- Forwarded message ----------
From: Amit Langote <amitlangote09@gmail.com>
Date: Thu, Apr 3, 2014 at 1:53 PM
Subject: Re: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN
... DEFAULT NULL
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres General <pgsql-general@postgresql.org>


On Thu, Apr 3, 2014 at 1:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Langote <amitlangote09@gmail.com> writes:
>> On Thu, Apr 3, 2014 at 12:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Some experimentation suggests that we are smart about "DEFAULT NULL"
>>> unless the column type requires a length-coercion cast, in which
>>> case the default expression involves a function call, and that doesn't
>>> get elided.
>
>> Is there a warning about such behavior in the manual?
>> Is it useful to include it somewhere (not sure where though)?
>
> We could just rephrase the ALTER TABLE docs to say that the table
> rewrite is avoided if you omit the DEFAULT clause, rather than
> saying that a null default works.
>

How does the attached sound?
Wonder if a rewrite-warning is necessary?

--
Amit

Attachment

pgsql-docs by date:

Previous
From: Sehrope Sarkuni
Date:
Subject: Patch to add results for JSON operator examples
Next
From: Tom Lane
Date:
Subject: Re: Fwd: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL