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 1ggcMC-00064t-LC for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 21:22:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggcMB-0007Aj-59 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Jan 2019 21:22:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggcMA-0007AY-Rz for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 21:22:47 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggcM3-00064w-39 for pgsql-bugs@lists.postgresql.org; Mon, 07 Jan 2019 21:22:45 +0000 Received: from [192.168.10.146] (unknown [98.122.175.38]) (Authenticated sender: adsend@dunslane.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 4CDC310000A; Mon, 7 Jan 2019 21:22:33 +0000 (UTC) Subject: Re: BUG #15579: Adding a column with default from configuration parameter fails on 11.1 To: Andres Freund , Tom Lane Cc: fredrik.widlert@digpro.se, pgsql-bugs@lists.postgresql.org References: <15579-c1494c68abb011ec@postgresql.org> <3336.1546873079@sss.pgh.pa.us> <9c74611f-b373-3269-04b0-0803a217e1f1@dunslane.net> <4403.1546894903@sss.pgh.pa.us> <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de> From: Andrew Dunstan Openpgp: preference=signencrypt Autocrypt: addr=andrew@dunslane.net; prefer-encrypt=mutual; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2H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4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C 4R+M6w7o2PLGOjdZ+kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaY L++LAEOqrlvm2TvqQqZRtnEAEQEAAcLAZQQYAQIADwIbDAUCXA6fpAUJDyV6xAAKCRCZ+n/L Wfw7geU4B/9vFFsVmWxerDWgNjyiK80zIPmlw/iwdUlU6FIu0JWLMg4093kvxBs7RMZV9hBq n3ekBvD4IvFsVLJrw9qzSI2FH3UeYy5WXpEs01Ppia60NOlvRDqXbryzuvfe+iYo6bVP3Ikr TPTNYL/BePUTD2DPvSI82SbGTyzuA7SJv6NRqqQDMIy1fU6KyQFLmQJp/QJyhKWzm9jWh8ee w8jVaoMY0Kbq5N7RqisEx1Lu/Iw646UphdYzQNymf+kbiU5Kf4I6DhzV8w9sie1Bo1juNj3I c5/fFJsmxljbnaDbXPcnFsur1Oo9mIHFakgWgOBMuxoWfjONiLjjLh/9+ZIqSSLX Message-ID: <80c8c7e4-8756-d206-bdd4-c1e69e4f9d4a@dunslane.net> Date: Mon, 7 Jan 2019 16:22:31 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190107211120.6dztmhvm3hmmee4z@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/7/19 4:11 PM, Andres Freund wrote: > 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. That's true. But only slightly less transparent, I'd suggest :-) > 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.. > agreed. It might be worth a doc note? cheers andrew