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 1g9kyV-0003VF-KA for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Oct 2018 05:54:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9kyT-0002da-S1 for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Oct 2018 05:54:29 +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 1g9kyT-0002dT-Lx for pgsql-bugs@lists.postgresql.org; Tue, 09 Oct 2018 05:54:29 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9kyM-0004ee-RQ for pgsql-bugs@postgresql.org; Tue, 09 Oct 2018 05:54:29 +0000 Received: from [192.168.127.1] (port=54433 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1g9kyK-000GP0-5Z; Tue, 09 Oct 2018 05:54:20 +0000 Received: from [127.0.0.1] (port=61668 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1g9kyJ-000Gh3-GO; Tue, 09 Oct 2018 05:54:19 +0000 From: Andrew Gierth To: Jim Finnerty Cc: pgsql-bugs@postgresql.org Subject: Re: IMMEDIATE constraint enforcement does not comply with the SQL standard In-Reply-To: <1539036309291-0.post@n3.nabble.com> (Jim Finnerty's message of "Mon, 8 Oct 2018 15:05:09 -0700 (MST)") Message-ID: <87zhvn8ysq.fsf@news-spur.riddles.org.uk> References: <24593.1539035385@sss.pgh.pa.us> <1539036309291-0.post@n3.nabble.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Tue, 09 Oct 2018 06:54:18 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Jim" == Jim Finnerty writes: Jim> The consequences of non-compliance is much more insidious than it Jim> at first appears. At stake here is whether PostgreSQL supports Jim> non-deferrable constraints at all. The purpose of having Jim> non-deferrable IMMEDIATE constraints in the standard is to make Jim> query optimizations possible. Unfortunately the possibility of query optimizations for FKs is already defeated by the issue of referential actions, where we also violate the spec. https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard#Trigger_firing_relative_to_referential_constraint_actions (I just added your issue to that entry, which was already there to discuss the referential actions vs BEFORE trigger timing.) -- Andrew (irc:RhodiumToad)