Re: Command order bug in pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Command order bug in pg_dump
Date: 2025-04-22 20:53:23
Message-ID: 1218166.1745355203@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Alvaro Herrera <alvherre(at)kurilemu(dot)de> writes:
>> On 2025-Apr-21, Tom Lane wrote:
>>> I experimented with the attached, which approximates "add some digits
>>> to the name used for the parent constraint". (We could refactor
>>> ChooseConstraintName if we wanted a less approximate version of that
>>> rule, but I'm not sure it's worth the trouble.)

>> This seems a better implementation of the idea than what I had in mind.
>> For my part, please feel free to go ahead with this.

> OK. I'll take a look first at whether the aforesaid refactoring
> is easy enough to be worth doing.

After poking at that, it's easy to get ChooseConstraintName to do
something just slightly different from what I said above: the rule is
now "add an underscore and some digits to the name used for the parent
constraint". I like this even better than the previous idea, because
I think it makes it more obvious that the name is derived from the
parent constraint. However, this changes the chosen name in more
cases than my previous hack did. So I'm reposting the patch to see
if anyone feels this is too much churn. I think it's okay as a
v18-only patch, though I wouldn't propose it for back-patch.

regards, tom lane

Attachment Content-Type Size
v2-rename-child-foreign-key-constraints.patch text/x-diff 25.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-04-23 01:41:20 RE: Disabled logical replication origin session causes primary key errors
Previous Message Shawn McCoy 2025-04-22 20:10:02 Re: Disabled logical replication origin session causes primary key errors