From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix error code for referential action RESTRICT
Date: Mon, 02 Dec 2024 07:26:20 +0000
Message-ID: <E1tI0p2-000huS-C3@gemulon.postgresql.org> (raw)
Fix error code for referential action RESTRICT
According to the SQL standard, if the referential action RESTRICT is
triggered, it has its own error code. We previously didn't use that,
we just used the error code for foreign key violation. But RESTRICT
is not necessarily an actual foreign key violation. The foreign key
might still be satisfied in theory afterwards, but the RESTRICT
setting prevents the action even then. So it's a separate kind of
error condition.
Discussion: https://www.postgresql.org/message-id/ea5b2777-266a-46fa-852f-6fca6ec480ad@eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/086c84b23d99c2ad268f97508cd840efc1fdfd79
Modified Files
--------------
src/backend/utils/adt/ri_triggers.c | 32 +++++++++++++++++----
src/test/regress/expected/collate.icu.utf8.out | 4 +--
src/test/regress/expected/foreign_key.out | 16 +++++------
src/test/regress/expected/without_overlaps.out | 40 +++++++++++++-------------
4 files changed, 57 insertions(+), 35 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix error code for referential action RESTRICT
In-Reply-To: <E1tI0p2-000huS-C3@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox