pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_upgrade: Don't run the not-null inheritance check on v18 clus
Date: Thu, 26 Nov 2026 11:50:14 +0000
Message-ID: <E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org> (raw)

pg_upgrade: Don't run the not-null inheritance check on v18 clusters

check_for_not_null_inheritance() checks for the situation that a
column in a parent table has a not-null constraint, but the
corresponding column in a child table does not.  That can no longer
happen on v18 (since commit 14e87ffa5c5), but because of a mistake in
the version guard, we ran the check unnecessarily on a v18 source
cluster, too.  You would think that's harmless, but starting with
version 18, you can have a not-null constraint marked as NO INHERIT on
the parent, which the check query didn't take into account.  Such
constraints would trip the check query, preventing the upgrade
unnecessarily.

Bug: #19928
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Reviewed-by: Raja Sai Pranav <rajasaipranav0@gmail.com>
Discussion: https://www.postgresql.org/message-id/19928-c3f1f0dc1c0a44e9@postgresql.org
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c224480faebcfc557ed4405fd6c7d12e1f4840f7

Modified Files
--------------
src/bin/pg_upgrade/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org>
Permalink:  ../E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: pg_upgrade: Don't run the not-null inheritance check on v18 clus
  In-Reply-To: <E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org>
  References: <E1xWXzS-00000000OKV-2reW@gemulon.postgresql.org>

* 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