pgsql: pg_upgrade: Don't run the not-null inheritance check on v18 clus
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: /messages/by-id/19928-c3f1f0dc1c0a44e9@postgresql.org
Backpatch-through: 18
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/388f2db2994e216f15f004c4addbe4851871f954
Modified Files
--------------
src/bin/pg_upgrade/check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)