Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHbCN-0006Ge-77 for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Oct 2018 21:05:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHbCL-0001HT-AD for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Oct 2018 21:05:13 +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 1gHbCL-0001HF-38 for pgsql-bugs@lists.postgresql.org; Tue, 30 Oct 2018 21:05:13 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHbCD-000352-DH for pgsql-bugs@postgresql.org; Tue, 30 Oct 2018 21:05:12 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 3206D10013304 for ; Tue, 30 Oct 2018 14:05:03 -0700 (MST) Date: Tue, 30 Oct 2018 14:05:03 -0700 (MST) From: Jim Finnerty To: pgsql-bugs@postgresql.org Message-ID: <1540933503202-0.post@n3.nabble.com> In-Reply-To: <17500.1540931906@sss.pgh.pa.us> References: <1540931408693-0.post@n3.nabble.com> <17500.1540931906@sss.pgh.pa.us> Subject: Re: BEFORE triggers that return NULL can circumvent referential integrity 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 re: There is also nonstandard behavior if BEFORE triggers modify rows or prevent updates during an update that is caused by a referential action. This can lead to constraint violations or stored data that does not honor the referential constraint. That supports the position that it was already documented, I'll grant you that. It is clearly a bug if it causes foreign key constraints to be violated, documented or not. Otherwise foreign key constraints mean nothing in PostgreSQL. I don't think this would be particularly difficult to fix so that it causes the statement to fail when there is a referential action, rather than silently returning and leaving the database in an inconsistent state. What is the argument in favor of retaining behavior that renders foreign keys meaningless? What is the process for deciding whether a report represents an actionable bug that ought to be fixed by the community? /Jim ----- Jim Finnerty, AWS, Amazon Aurora PostgreSQL -- Sent from: http://www.postgresql-archive.org/PostgreSQL-bugs-f2117394.html