Part of #8597.
The foreign_key_to_reference_table partition test creates both a partition-to-partition fkey and a partition-to-reference-table fkey_to_ref on the same partition. Its original negative row violated both constraints simultaneously, so PostgreSQL 17/18 and PostgreSQL 19 could report different valid constraints first without independently proving both enforcement paths.
Make the checks deterministic and mutually exclusive:
- seed reference key
5 before inserting (0, 5), leaving only the partition-to-partition fkey unsatisfied;
- insert
id = 0 into the referenced partition, then use missing reference key 4 for the separate fkey_to_ref failure;
- retain the final successful
(0, 5) insert after both constraints are satisfied;
- use one primary expected output on PostgreSQL 17, 18, and 19, with no numbered alternative and no broader normalization.
Verify the focused regression test on PostgreSQL 17.10, 18.4, and 19beta2, and confirm each version reports fkey for the first negative insert and fkey_to_ref for the second.
Part of #8597.
The
foreign_key_to_reference_tablepartition test creates both a partition-to-partitionfkeyand a partition-to-reference-tablefkey_to_refon the same partition. Its original negative row violated both constraints simultaneously, so PostgreSQL 17/18 and PostgreSQL 19 could report different valid constraints first without independently proving both enforcement paths.Make the checks deterministic and mutually exclusive:
5before inserting(0, 5), leaving only the partition-to-partitionfkeyunsatisfied;id = 0into the referenced partition, then use missing reference key4for the separatefkey_to_reffailure;(0, 5)insert after both constraints are satisfied;Verify the focused regression test on PostgreSQL 17.10, 18.4, and 19beta2, and confirm each version reports
fkeyfor the first negative insert andfkey_to_reffor the second.