Re: BUG #19393: pg_upgrade fails with duplicate key violation when CHECK constraint named *_not_null exists

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>, huseyin.d3r@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2026-02-10T00:37:09Z
Lists: pgsql-bugs, pgsql-hackers
On Fri, Feb 06, 2026 at 04:16:08PM +0530, Dilip Kumar wrote:
> Right I see, I was talking about the similar case something like[1]
> but I see it already handles the conflict and generates a conflicting
> name if a constraint with the name already exists.  So we are good,
> thanks.

I had this patch marked on my tablets for a lookup, with the hope that
it would have been possible to get something done for this week's
release, unfortunately I got drifted away and lacked time.  I'll look
into what you have here.
--
Michael

Commits

  1. Update .abi-compliance-history for AddRelationNotNullConstraints().

  2. Avoid name collision with NOT NULL constraints