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 19:27:16
Message-ID: 3144564.1607369236@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron <ronljohnsonjr(at)gmail(dot)com> writes:
> Neither technique worked.

> test=# ALTER TABLE sales_detail ALTER CONSTRAINT
> fk_sales_detail_sales_header DEFERRABLE INITIALLY DEFERRED;
> ALTER TABLE

Hmm, reproduced here. There seems to be some kind of bug
in ALTER CONSTRAINT --- it looks like it's updated all the
child FKs successfully, but it actually hasn't. If you
drop the FK constraint altogether, and recreate it having
DEFERRABLE INITIALLY DEFERRED from the start, it should
work --- at least it does for me.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message legrand legrand 2020-12-07 19:54:46 Re: simple reporting tools for postgres in aws
Previous Message Joshua Drake 2020-12-07 18:35:39 Re: PL/java