Re: BUG #18202: pg_constraint data isn't refreshed when using alter rename to on a constraint trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: eric(dot)cyr(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18202: pg_constraint data isn't refreshed when using alter rename to on a constraint trigger
Date: 2023-11-17 15:17:23
Message-ID: 564633.1700234243@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> When we rename a constraint trigger it seems like the name is not updated in
> pg_constraint.

Hmm, yeah ... renametrig() is intent on renaming the entry in pg_trigger,
but I see no code there that pays any attention to pg_constraint.
Conversely, ALTER TABLE RENAME CONSTRAINT updates the pg_constraint
entry but not the associated trigger. It's not real clear to me
whether this is intentional. There's no a-priori reason why the
two objects have to have the same name; but I doubt we have pg_dump
support for recreating a situation where they are different.
[ experiments ... ] Interestingly, pg_dump seems to dump the name
from pg_trigger not the one from pg_constraint.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2023-11-17 15:31:00 Re: Memory leak on subquery as scalar operand
Previous Message Tomas Vondra 2023-11-17 14:40:35 Re: Logical replication is missing block of rows when sending initial sync?