Skip to content

Commit

Permalink
[dev] Add more debugging information on violation
Browse files Browse the repository at this point in the history
  • Loading branch information
jhf committed Jun 1, 2024
1 parent cd69586 commit 17e73d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql_saga--1.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ BEGIN
INTO violation;

IF violation THEN
RAISE DEBUG 'Violation detected for FK: %, Row Data: %', foreign_key_name, row_data;
RAISE EXCEPTION 'update or delete on table "%" violates foreign key constraint "%" on table "%"',
foreign_key_info.uk_table_oid::regclass,
foreign_key_name,
Expand All @@ -1928,6 +1929,7 @@ BEGIN
INTO violation;

IF violation THEN
RAISE DEBUG 'Violation detected for FK: %, Row Data: %', foreign_key_name, row_data;
RAISE EXCEPTION 'update or delete on table "%" violates foreign key constraint "%" on table "%"',
foreign_key_info.uk_table_oid::regclass,
foreign_key_name,
Expand Down

0 comments on commit 17e73d4

Please sign in to comment.