Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZF9-0004pr-2N for pgsql-general@arkaria.postgresql.org; Thu, 03 Apr 2014 04:27:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WVZF8-0007XY-EE for pgsql-general@arkaria.postgresql.org; Thu, 03 Apr 2014 04:27:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZF7-0007XP-2k for pgsql-general@postgresql.org; Thu, 03 Apr 2014 04:27:09 +0000 Received: from mail-oa0-x236.google.com ([2607:f8b0:4003:c02::236]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WVZF4-0002BM-5V for pgsql-general@postgresql.org; Thu, 03 Apr 2014 04:27:08 +0000 Received: by mail-oa0-f54.google.com with SMTP id n16so1405936oag.27 for ; Wed, 02 Apr 2014 21:27:05 -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=dhNDz2MtJ9OJ8zj7zsDebCLgmbPMHpCd1IWN/iI6pdg=; b=tIFyaNojYsXUiyldUpkwsM68Phaq8jUq2XERH0M1xFRC5Hitv73Uvja9fpjmYa4y7n GFUKBzWv7mJ4uq9hI1V8xfyqOjnt9Tnc9RLPlJYT7E8V0FyYAUq0RFpuwdYVMvnq5UIy cTkRtMPrtSOXO13imNa89eysnymkiK4wuALZvEXBaUGXzhmUUgaeGdK/k9hmOtzSbxUQ ns4yQ3xPhetkbi2ofz2TkZR0RieqeQusMaAdI9JnjXwXKhvWpvkwgKZyHsU/3J5cbc+w amVg/5WNYl5/LnYUT3bZ5KTYXdUK5j+2yOe55OpnZMuKVUsoTt7tiSEzh6/DJ+6CeLD+ Vfwg== X-Received: by 10.60.160.201 with SMTP id xm9mr170917oeb.50.1396499225722; Wed, 02 Apr 2014 21:27:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.169.98 with HTTP; Wed, 2 Apr 2014 21:26:45 -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:26:45 +0900 Message-ID: Subject: Re: Table Rewrite During ALTER TABLE ... ADD COLUMN ... DEFAULT NULL To: Tom Lane Cc: Postgres General Content-Type: text/plain; charset=UTF-8 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 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. > Agreed. -- Amit -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general