]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix determination of not-null constraint "locality" for inherited columns
authorÁlvaro Herrera <alvherre@kurilemu.de>
Sat, 18 Oct 2025 16:18:19 +0000 (18:18 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Sat, 18 Oct 2025 16:18:19 +0000 (18:18 +0200)
commit0fe07fa115f520a67b9a9180cea703e91d8c7ac4
tree9878dfa21481b6289580f1849ba5944842a1f4fe
parent162e70ea06eb31dfe8f75bf508afde323eb0b077
Fix determination of not-null constraint "locality" for inherited columns

It is possible to have a non-inherited not-null constraint on an
inherited column, but we were failing to preserve such constraints
during pg_upgrade where the source is 17 or older, because of a bug in
the pg_dump query for it.  Oversight in commit 14e87ffa5c54.  Fix that
query.  In passing, touch-up a bogus nearby comment introduced by the
same commit.

In version 17, make the regression tests leave a table in this
situation, so that this scenario is tested in the cross-version upgrade
tests of 18 and up.

Author: Dilip Kumar <dilipbalaut@gmail.com>
Reported-by: Andrew Bille <andrewbille@gmail.com>
Bug: #19074
Backpatch-through: 18
Discussion: https://postgr.es/m/19074-ae2548458cf0195c@postgresql.org
src/bin/pg_dump/pg_dump.c
src/test/regress/expected/constraints.out
src/test/regress/sql/constraints.sql