Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZnw-00060z-HJ for pgsql-docs@arkaria.postgresql.org; Thu, 03 Apr 2014 05:03:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WVZnv-0008Hr-7x for pgsql-docs@arkaria.postgresql.org; Thu, 03 Apr 2014 05:03:07 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZnu-0008Hk-5d for pgsql-docs@postgresql.org; Thu, 03 Apr 2014 05:03:06 +0000 Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZnr-0002nO-6p for pgsql-docs@postgresql.org; Thu, 03 Apr 2014 05:03:05 +0000 Received: by mail-ob0-f182.google.com with SMTP id uz6so1402515obc.41 for ; Wed, 02 Apr 2014 22:03:02 -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 :content-type; bh=eepYx5A01o19nFK8hudUED3ywuHDaVaOh49zdpSclwU=; b=MFtk+8iGzz/2qAzifjZvFwGuOWasSaRsiaTOQztAqtgXom6dBXtjB5GF+9sch1w/CD yvppxWbgr5HsVKU/HBjUgkkQvf1e+4+E+j108L7aWQdWBFXK687fgyjk53rcrINHY6EJ x6ka9p5FvYFBGp4/00Ek987u5ZJsN5MqAbG4lgd7b2q40l6b25GKetIG5iS6/JydO4BP jsfJn1t3Rmq3APjOZPhYma1wOZ6z8DfunfS2DxCXHo4xzpSMhxxo3hCCEOgzpLMeFgbC zie9sMosQg7YV5cY24dzP43YD4ngYQYtSKyt1fgPgaMVgTtggUtbagIh1uXyG4ifx1qk GfLA== X-Received: by 10.60.176.9 with SMTP id ce9mr2594oec.55.1396501381886; Wed, 02 Apr 2014 22:03:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.169.98 with HTTP; Wed, 2 Apr 2014 22:02:41 -0700 (PDT) In-Reply-To: References: <3036.1396497272@sss.pgh.pa.us> <3704.1396498776@sss.pgh.pa.us> From: Amit Langote Date: Thu, 3 Apr 2014 14:02:41 +0900 Message-ID: Subject: Fwd: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL To: pgsql-docs@postgresql.org Content-Type: multipart/mixed; boundary=089e0118226cccf1f804f61c5064 X-Pg-Spam-Score: -1.8 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org --089e0118226cccf1f804f61c5064 Content-Type: text/plain; charset=UTF-8 ---------- Forwarded message ---------- From: Amit Langote Date: Thu, Apr 3, 2014 at 1:53 PM Subject: Re: [GENERAL] Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL To: Tom Lane Cc: Postgres General 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 --089e0118226cccf1f804f61c5064 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= --089e0118226cccf1f804f61c5064 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --089e0118226cccf1f804f61c5064--