Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9deV-00027K-9l for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Oct 2018 22:05:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9deQ-0002hF-LO for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Oct 2018 22:05:18 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9deQ-0002h8-FM for pgsql-bugs@lists.postgresql.org; Mon, 08 Oct 2018 22:05:18 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9deJ-0002MN-EW for pgsql-bugs@postgresql.org; Mon, 08 Oct 2018 22:05:17 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 52D18F9C63DD for ; Mon, 8 Oct 2018 15:05:09 -0700 (MST) Date: Mon, 8 Oct 2018 15:05:09 -0700 (MST) From: Jim Finnerty To: pgsql-bugs@postgresql.org Message-ID: <1539036309291-0.post@n3.nabble.com> In-Reply-To: <24593.1539035385@sss.pgh.pa.us> References: <24593.1539035385@sss.pgh.pa.us> Subject: Re: IMMEDIATE constraint enforcement does not comply with the SQL standard MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk We do want standard-compliant behavior, and standard-compliance a strength of PostgreSQL, and as mentioned we already do have a way (DEFERRABLE INITIALLY DEFERRED) if this is the user's intent. The consequences of non-compliance is much more insidious than it at first appears. At stake here is whether PostgreSQL supports non-deferrable constraints at all. The purpose of having non-deferrable IMMEDIATE constraints in the standard is to make query optimizations possible. Also, as far as I can tell, we do not document the specific name that we generate for constraint triggers; therefore, any application that depends on undocumented naming conventions is skating on precariously thin ice, in addition to writing non-portable code. The equivalent logic was implemented on Oracle and MySQL. Both of those systems implement IMMEDIATE mode constraints consistently with the standard, and produce a different result than PostgreSQL. best regards, /Jim F ----- Jim Finnerty, AWS, Amazon Aurora PostgreSQL -- Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html