From 60cd164cc25e4b0815aa1fbc410dc1607a517080 Mon Sep 17 00:00:00 2001 From: Raja Sai Pranav Date: Thu, 26 Nov 2026 15:10:09 +0530 Subject: [PATCH v2] pg_upgrade: Don't run the not-null inheritance check on v18 clusters check_for_not_null_inheritance() looks for child columns that lack a not-null constraint their parent column has. Before v18 that could happen, and schema restore fails for it. In v18 a child column cannot lose an inherited not-null constraint, so the check has nothing to find and only produces false reports: a parent column with a NO INHERIT not-null constraint does not apply to its children, but the check still lists the nullable child column and fails the upgrade. The check was left enabled for v18 clusters when it was added early in the v18 development cycle, to cover upgrades from older v18devel clusters, which no longer need support. Run it only for clusters before v18. Bug #19928 --- src/bin/pg_upgrade/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index 2d4aaf22a0..2da1962fa1 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -670,7 +670,7 @@ check_and_dump_old_cluster(void) * parents columns have, but schema restore fails for them. Verify there * are none, iff applicable. */ - if (GET_MAJOR_VERSION(old_cluster.major_version) <= 1800) + if (GET_MAJOR_VERSION(old_cluster.major_version) <= 1700) check_for_not_null_inheritance(&old_cluster); /* -- 2.50.1 (Apple Git-155)