Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyipG-0007lJ-9B for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Nov 2022 00:13:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oyipE-0002QK-SC for pgsql-bugs@arkaria.postgresql.org; Sat, 26 Nov 2022 00:13:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyipE-0002QA-KS for pgsql-bugs@lists.postgresql.org; Sat, 26 Nov 2022 00:13:44 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyip7-0001ia-5B for pgsql-bugs@lists.postgresql.org; Sat, 26 Nov 2022 00:13:43 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by mail.gandi.net (Postfix) with ESMTPSA id A774420005; Sat, 26 Nov 2022 00:13:29 +0000 (UTC) Message-ID: <7464b4ea-1f3b-b4db-f97c-38957dbee87a@postgresfriends.org> Date: Sat, 26 Nov 2022 01:13:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17696: Creation of deferrable initially deferred constraint breaks before transaction commit Content-Language: en-US To: Tom Lane , Alvaro Herrera Cc: "David G. Johnston" , Roman Garcia , pgsql-bugs@lists.postgresql.org References: <20221124222356.qolurdwwcnxkbjt2@alvherre.pgsql> <3976549.1669344944@sss.pgh.pa.us> From: Vik Fearing In-Reply-To: <3976549.1669344944@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/25/22 03:55, Tom Lane wrote: > On the whole I share David's guess that the cost/benefit ratio of > making this happen is unattractive. I might feel impelled to do > it anyway if somebody could show that the SQL spec requires it ... > but I bet you'll search for that in vain, because I doubt that the > SQL spec requires transactional DDL at all. (There are too many > influential implementations that would have a problem with that.) The spec does require transactional DDL (SQL:2016 4.41.1 General description of SQL-transactions) but does not allow mixing of DDL and DML in the same transaction. What happens when you do that is implementation-defined. So in this case it would not really matter when the new constraint is verified because the user would have no opportunity to fix the data anyway. -- Vik Fearing