Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggcBM-0005il-3K for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 21:11:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggcBK-0004oF-P9 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 21:11:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggcBI-0004ns-JT for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 21:11:34 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggcBB-0000c5-8B for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 21:11:32 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7200924358; Mon, 7 Jan 2019 16:11:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 07 Jan 2019 16:11:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=KjdBairyFq/wDuJ+mAYzpGBO+cQ 0xSs2wIZvoR1ckgA=; b=v9KvWVWwt2LLZs4M+9y8DzmK6aARuFTuZBjuMwoXxty IcBEo8Ddg/LbkevGsF7Ax6CuBMJpiuom+RWtYprlNeNYTnSHwTrzRshiYfk4+qfj tUlY1aPFC3pPsMLK5hWsb5OAk0TbmVPRzuPDLfDXwHgDfrIY3NcWgF+jiO53mVeb 7SSCdAER1V32v7hYPDQjyI8eMPmPXvr0ZI9lhF0QONPiau7bQerdVUsLotq+tpQY OGN2jCS4orWJrlzigMrx3M9uaV/9eKsP5v2J6Od3NlIxhgIqMW81Vv/0Ji81AzPu Wz3hGmKYs6PSYCSPfKIPU/GnHuLjAkIM1WOHLvMafRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=KjdBai ryFq/wDuJ+mAYzpGBO+cQ0xSs2wIZvoR1ckgA=; b=y1UcjYtm3J1Loy7/CiRkaR HQA7p5rRZged34Q0hDprdg7oIfN1RoDcLSa6XZKOQekDDURNxgacAY6sufKjDliI j48a2+iwoh1NKIBGG4DQINjFBTozObHtr0ST2UT0ipEi7ULq46z9TAu6qS04frCz iiNEdP3+p3G7CHaXR2CZCKG4dM13C10KKjaI3oNYwzBHHRDsMTh+SjBsI7Osg8Os iPx68rSb3Oqm0iLLjllGKw3R0mCbMQxtAgmnkPuczspIQYVCRoUxiUHMjpNZdQoz vwx+HfZkdwnNqL3UfABj8wxg9FB+QBgp8E8255uQgNnHTTN9WTqOYtYTW9L1prjg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdejgddugeegucdltddurdegtdekrddttd dmucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhht necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppe elkedrvddutddrudegtddrudejudenucfrrghrrghmpehmrghilhhfrhhomheprghnughr vghssegrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id 7AE9CE40FF; Mon, 7 Jan 2019 16:11:22 -0500 (EST) Date: Mon, 7 Jan 2019 13:11:20 -0800 From: Andres Freund To: Tom Lane Cc: Andrew Dunstan , fredrik.widlert@digpro.se, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1 Message-ID: <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de> References: <15579-c1494c68abb011ec@postgresql.org> <3336.1546873079@sss.pgh.pa.us> <9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net> <4403.1546894903@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4403.1546894903@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-01-07 16:01:43 -0500, Tom Lane wrote: > Andrew Dunstan writes: > > Stable expressions are quite ok for fast defaults. The expression is > > evaluated once when the ALTER TABLE is done and the result (not the > > expression) is stored in the catalog. The reason we check for volatile > > expressions is precisely because we don't want all the existing rows to > > get a single value in that case. This was discussed during the Postgres > > 11 development cycle. > > Hmm. > > The issue here is that if the table is empty, the old behavior evaluated > the expression zero times during ALTER TABLE. Now we evaluate it once, > and if that throws an error, that's a user-visible behavior change. > > Perhaps it's okay to decide that that's an acceptable behavioral change, > but it makes this feature less transparent than it was supposed to be. It doesn't seem too hard to scan far enough to see whether there's a single non-dead row. So we could fix this, if we wanted. But I'm disinclined to think that it's worth doing so - and there could be drawbacks, e.gg tables that are all-dead. Given the IMO quite minor behaviour change, I'm thus disinclined to "fix" this.. Greetings, Andres Freund