Re: Deferrable FK not behaving as expected.

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Deferrable FK not behaving as expected.
Date: 2020-12-07 18:19:07
Message-ID: b97cbd9d-1615-c9e1-aff1-683a37fedee9@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2020-12-07 18:26:26 Re: Deferrable FK not behaving as expected.
Previous Message Ron 2020-12-07 18:15:20 Deferrable FK not behaving as expected.