Re: Deferrable FK not behaving as expected.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Date: 2020-12-07T21:40:02Z
Lists: pgsql-general
Ron <ronljohnsonjr@gmail.com> writes: > That works *sometimes*, but not when we *really* want it to work. > test=# begin transaction; > BEGIN > test=# ALTER TABLE sales_header DETACH PARTITION sales_header_202001; > ERROR: removing partition "sales_header_202001" violates foreign key > constraint "sales_detail_cust_id_order_ts_fkey" That I think you're gonna have to live with. DETACH PARTITION isn't something we can defer to end of transaction. regards, tom lane
Commits
-
Have ALTER CONSTRAINT recurse on partitioned tables
- 6f70d7ca1d19 14.0 landed
- abce26c9eb95 12.7 landed
- a25b98d2cf38 11.12 landed
- 923c13520f1b 13.3 landed