From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: jian he <jian.universality@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Tender Wang <tndrwang@gmail.com>
Subject: Re: not null constraints, again
Date: Mon, 14 Apr 2025 17:39:01 -0400
Message-ID: <1453482.1744666741@sss.pgh.pa.us> (raw)
In-Reply-To: <202504142133.qeqgu7ujm4ie@alvherre.pgsql>
References: <202504142133.qeqgu7ujm4ie@alvherre.pgsql>
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2025-Apr-14, Tom Lane wrote:
>> I would not have expected that adding pg_constraint rows implies
>> stronger locks than what ALTER ADD PRIMARY KEY was using before,
>> and I suspect that doing so will cause more problems than just
>> breaking parallel restore.
> I wasn't aware of this side effect. I'll investigate this in more
> depth. I suspect it might be a bug in the way we run through ALTER
> TABLE for the primary key.
After further thought it occurs to me that it might not be a case
of "we get stronger locks", but a case of "we accidentally get a
weaker lock earlier and then try to upgrade it", thus creating a
possibility of deadlock where before we'd just have blocked till
the other statement cleared. Still worthy of being fixed if that's
true, though.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, jian.universality@gmail.com, pgsql-hackers@lists.postgresql.org, tndrwang@gmail.com
Subject: Re: not null constraints, again
In-Reply-To: <1453482.1744666741@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