Re: ALTER CONSTRAINT on a partitioned FK isn't working

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: ALTER CONSTRAINT on a partitioned FK isn't working
Date: 2020-12-07 23:34:14
Message-ID: 20201207233414.GA24167@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2020-Dec-07, Tom Lane wrote:

> then everything behaves as expected. So something is broken
> about propagating deferred-ness to partition triggers in an
> ALTER CONSTRAINT. Oddly, it *looks* like it worked if you
> examine the child tables with "\d+". I surmise that ALTER CONSTRAINT
> fixes whatever catalog fields psql looks at, but there's some other
> fields that also need to be updated and aren't being.

Yeah, this query shows that the tgdeferrable and tginitdeferred columns
ought to be dropped:

select tgname, tgdeferrable, tginitdeferred from pg_trigger;

These are all 'true' when the constraint is created correctly, and false
when changed by ALTER CONSTRAINT.

Let me see about fixing that ...

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2020-12-07 23:52:06 Re: ALTER CONSTRAINT on a partitioned FK isn't working
Previous Message Tom Lane 2020-12-07 19:33:53 ALTER CONSTRAINT on a partitioned FK isn't working