Re: Deferrable FK not behaving as expected.
shammat@gmx.net
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Date: 2020-12-07T18:19:07Z
Lists: pgsql-general
Ron schrieb am 07.12.2020 um 19:15:
> Referenced by:
> TABLE "sales_detail" CONSTRAINT "fk_sales_detail_sales_header"
> FOREIGN KEY (cust_id, order_ts) REFERENCES sales_header(cust_id, order_ts) *DEFERRABLE*
I think if you only mention "deferrable" this is the same as "deferrable initially immediate",
so you will need to make them deferrable in your transaction:
SET CONSTRAINTS ALL DEFERRED;
or create the constraint with
deferrable initially deferred
Thomas
Commits
-
Have ALTER CONSTRAINT recurse on partitioned tables
- 6f70d7ca1d19 14.0 landed
- abce26c9eb95 12.7 landed
- a25b98d2cf38 11.12 landed
- 923c13520f1b 13.3 landed