Fix error code for referential action RESTRICT
Peter Eisentraut <peter@eisentraut.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/ri_triggers.c | modified | +27 −5 |
| src/test/regress/expected/collate.icu.utf8.out | modified | +2 −2 |
| src/test/regress/expected/foreign_key.out | modified | +8 −8 |
| src/test/regress/expected/without_overlaps.out | modified | +20 −20 |
Discussion
- altering a column's collation leaves an invalid foreign key 28 messages · 2024-03-23 → 2024-12-02