public inbox for [email protected]
help / color / mirror / Atom feedFrom: Hüseyin Demir <[email protected]>
To: Laurenz Albe <[email protected]>
Cc: [email protected]
Subject: Re: BUG #19393: pg_upgrade fails with duplicate key violation when CHECK constraint named *_not_null exists
Date: Mon, 9 Feb 2026 18:16:26 +0100
Message-ID: <CAB5wL7ay2WNdAJZLoDngou=qa4y=uKkQhLZbNVg8kcduwkYqpQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAB5wL7aPZ_GPEZkMtkcnQjmv_uMxjJZmsrCf9onDCJGL_NUtTg@mail.gmail.com>
<[email protected]>
Hi,
> I would prefer not to, but I don't have a strong opinion about it.
> Which name PostgreSQL chooses for the generated NOT NULL constraint
> is not important, as long as it doesn't conflict with the existing name.
I also agree that it solves the problem in 18 which I already tested.
Thanks again for your help.
Laurenz Albe <[email protected]>, 9 Şub 2026 Pzt, 12:01 tarihinde
şunu yazdı:
> On Mon, 2026-02-09 at 07:24 +0100, Hüseyin Demir wrote:
> > Thanks for the patch and LGTM for PostgreSQL 18.
>
> Thanks for checking!
>
> > I tried to create following table on PG18
> >
> > benchmark=# CREATE TABLE two_not_null_constraints (
> > col integer NOT NULL,
> > CONSTRAINT two_not_null_constraints_col_not_null CHECK (col IS NOT
> NULL)
> > );
> > ERROR: duplicate key value violates unique constraint
> "pg_constraint_conrelid_contypid_conname_index"
> > DETAIL: Key (conrelid, contypid, conname)=(16385, 0,
> two_not_null_constraints_col_not_null) already exists.
> >
> > In PG17 I was able to create the table.
>
> Yes, because what causes your problemm is a new feature in v18.
>
> > One question during the tests should we confirm the output of
> pg_constraint table ?
> > It would make sense during the tests but the current test is also good
> to proceed.
>
>
>
> Yours,
> Laurenz Albe
>
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: BUG #19393: pg_upgrade fails with duplicate key violation when CHECK constraint named *_not_null exists
In-Reply-To: <CAB5wL7ay2WNdAJZLoDngou=qa4y=uKkQhLZbNVg8kcduwkYqpQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox