Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZfI-0005iM-Bt for pgsql-general@arkaria.postgresql.org; Thu, 03 Apr 2014 04:54:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WVZfH-0005Ut-Mn for pgsql-general@arkaria.postgresql.org; Thu, 03 Apr 2014 04:54:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZfG-0005Uk-9W for pgsql-general@postgresql.org; Thu, 03 Apr 2014 04:54:10 +0000 Received: from mail-oa0-x22c.google.com ([2607:f8b0:4003:c02::22c]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZfA-0004Ln-Cf for pgsql-general@postgresql.org; Thu, 03 Apr 2014 04:54:09 +0000 Received: by mail-oa0-f44.google.com with SMTP id n16so1424751oag.31 for ; Wed, 02 Apr 2014 21:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=0pzKzUxVst7bELcWiJiGb6eDexlt829GZ1okeOJEHEM=; b=phIh4rNgaz3vPTHBj4hJnG4QVx/M1hj1S5pZilQ8cp4Qag9KySfoqDQzPU/e8r8x5C OS4SNkP6VIuwzb0fNBmFTby24dpDS74rQ6Wrayr7xqu0MhhwxfaiEWFRc+qymI6sjg49 95atOCSesG6ekCy3RAe2lg017TmHKttqCWhnUXNxSlg3CtoWSej/rEY2WMFN1aKldFVh Dpb6IGbmiGTiw+YdV19zi4LQfk1aI+QW1YRr/jzJFVEs5k0pCVFPcoIeuVhdzvF2FfbF imDyk8M1H0UoG9IEesIylDQvC6FbaZtUK2wMKPbe3eE1sumAlDki9GZxOfV6/WOBKX/A WNjQ== X-Received: by 10.60.131.172 with SMTP id on12mr4712053oeb.18.1396500843243; Wed, 02 Apr 2014 21:54:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.169.98 with HTTP; Wed, 2 Apr 2014 21:53:43 -0700 (PDT) In-Reply-To: <3704.1396498776@sss.pgh.pa.us> References: <3036.1396497272@sss.pgh.pa.us> <3704.1396498776@sss.pgh.pa.us> From: Amit Langote Date: Thu, 3 Apr 2014 13:53:43 +0900 Message-ID: Subject: Re: Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL To: Tom Lane Cc: Postgres General Content-Type: multipart/mixed; boundary=047d7b41c25cb0c04104f61c30bf X-Pg-Spam-Score: -1.8 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org --047d7b41c25cb0c04104f61c30bf Content-Type: text/plain; charset=UTF-8 On Thu, Apr 3, 2014 at 1:19 PM, Tom Lane wrote: > Amit Langote writes: >> On Thu, Apr 3, 2014 at 12:54 PM, Tom Lane 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 --047d7b41c25cb0c04104f61c30bf Content-Type: application/octet-stream; name="alter-table-doc-fix.patch" Content-Disposition: attachment; filename="alter-table-doc-fix.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htjkd8dq0 ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9yZWYvYWx0ZXJfdGFibGUuc2dt bCBiL2RvYy9zcmMvc2dtbC9yZWYvYWx0ZXJfdGFibGUuc2dtbAppbmRleCA0 ODQ3ZDY2Li5kZTYzZTllIDEwMDY0NAotLS0gYS9kb2Mvc3JjL3NnbWwvcmVm L2FsdGVyX3RhYmxlLnNnbWwKKysrIGIvZG9jL3NyYy9zZ21sL3JlZi9hbHRl cl90YWJsZS5zZ21sCkBAIC04NTMsNyArODUzLDkgQEAgQUxURVIgVEFCTEUg WyBJRiBFWElTVFMgXSA8cmVwbGFjZWFibGUgY2xhc3M9IlBBUkFNRVRFUiI+ bmFtZTwvcmVwbGFjZWFibGU+CiAgICA8cGFyYT4KICAgICBXaGVuIGEgY29s dW1uIGlzIGFkZGVkIHdpdGggPGxpdGVyYWw+QUREIENPTFVNTjwvbGl0ZXJh bD4sIGFsbCBleGlzdGluZwogICAgIHJvd3MgaW4gdGhlIHRhYmxlIGFyZSBp bml0aWFsaXplZCB3aXRoIHRoZSBjb2x1bW4ncyBkZWZhdWx0IHZhbHVlCi0g ICAgKE5VTEwgaWYgbm8gPGxpdGVyYWw+REVGQVVMVDwvPiBjbGF1c2UgaXMg c3BlY2lmaWVkKS4KKyAgICAoTlVMTCBpZiBubyA8bGl0ZXJhbD5ERUZBVUxU PC8+IGNsYXVzZSBpcyBzcGVjaWZpZWQpLiBVc2VycyBhcmUgYWR2aXNlZAor ICAgIG5vdCB0byB1c2UgZXhwbGljaXQgPGxpdGVyYWw+REVGQVVMVDwvPiBj bGF1c2UgdW5sZXNzIHRoZXJlIGlzIGEgbm9uLW51bGwKKyAgICBkZWZhdWx0 IHZhbHVlIHRvIHNwZWNpZnkuCiAgICA8L3BhcmE+CiAKICAgIDxwYXJhPgo= --047d7b41c25cb0c04104f61c30bf Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general --047d7b41c25cb0c04104f61c30bf--