pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@kurilemu.de>
Cc: Kirill Reshke <reshkekirill@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Command order bug in pg_dump
Date: Wed, 23 Apr 2025 10:41:40 -0400
Message-ID: <1344634.1745419300@sss.pgh.pa.us> (raw)
In-Reply-To: <202504231301.ln7igwajlzu6@alvherre.pgsql>
References: <202504231301.ln7igwajlzu6@alvherre.pgsql>

Alvaro Herrera <alvherre@kurilemu.de> writes:
> I think the new constraint names are better, so +1 for this version of
> the patch for 18.  I agree that we don't necessarily want to backpatch
> this to stable branches though.

Cool, I'll push that patch in a bit then.

> I wonder if it would make pg_upgrade users' lives easier if we had
> pg_upgrade --check notify them about possible collisions on these
> constraints (for the older branches).  I don't have good ideas on how to
> implement that though other than a trial dump/restore, which is perhaps
> unreasonable.

Yeah, I'm not seeing a simple way to do that either.  I'm hesitant to
put a ton of work into it, because in the end the situation seems like
self-inflicted damage.  It's not quite true that you need duplicate
foreign key constraints to hit this, but it's close: the default
table-and-column-name-based name for one constraint has to match the
actual name of a second constraint.  If the second constraint isn't
a duplicate of the first then it has a very misleadingly chosen name.
Either way it's pretty poor DBA practice.

Between that thought and the fact that the problem has gone unnoticed
since v12, I'm content to make this change in the default names and
stop here.

			regards, tom lane





view thread (13+ messages)

Message-ID: <1344634.1745419300@sss.pgh.pa.us>
Permalink:  ../1344634.1745419300@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1344634.1745419300@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@kurilemu.de, reshkekirill@gmail.com
  Subject: Re: Command order bug in pg_dump
  In-Reply-To: <1344634.1745419300@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox