Re: Command order bug in pg_dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
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-21 19:41:54
Message-ID: 836817.1745264514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> Maybe we can change the naming policy so that these internal constraint
> objects have names that are unlikely to be chosen by users, maybe by
> suffixing "fkey_int" instead of "fkey", or something like that. (We
> could even do "$1" and so on for this kind of constraint). In
> hindsight, it isn't such a great idea to let the system choose the best
> name for an internal implementation object.

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.)

The extent to which these derived names leak out to the user, as
illustrated by the regression test changes, makes me even less happy
about the fact that \d doesn't show them. I think we really ought
to try to find a way to not need these entries. But that is clearly
not v18 material at this point.

> I'd probably not change this in versions 13 and 14 at all in any case,
> because the code is too different. I'm unsure whether this is enough of
> a bug to consider backpatching to 15-17; maybe we should just change 18
> at this point, since I haven't heard of a user complaining about this.

Kirill's complaint isn't that? But I agree that changing this rule in
stable branches would probably be a net negative user experience,
seeing that the names are plenty user-visible.

regards, tom lane

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Korotkov 2025-04-21 20:23:54 Re: BUG #18885: ERROR: corrupt MVNDistinct entry - 2
Previous Message Alvaro Herrera 2025-04-21 17:44:27 Re: Command order bug in pg_dump