Re: Deferrable FK not behaving as expected.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Deferrable FK not behaving as expected.
Date: 2020-12-07 21:40:02
Message-ID: 3159381.1607377202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron <ronljohnsonjr(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Gainty 2020-12-07 22:10:01 Re: PL/java
Previous Message Ron 2020-12-07 21:19:33 Re: Deferrable FK not behaving as expected.