| From: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix determination of not-null constraint "locality" for inherite |
| Date: | 2025-10-18 16:19:22 |
| Message-ID: | E1vA9eM-002KBe-0N@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)gmail(dot)com>
Reported-by: Andrew Bille <andrewbille(at)gmail(dot)com>
Bug: #19074
Backpatch-through: 18
Discussion: https://postgr.es/m/19074-ae2548458cf0195c@postgresql.org
Branch
------
REL_18_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/0fe07fa115f520a67b9a9180cea703e91d8c7ac4
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 8 +++++---
src/test/regress/expected/constraints.out | 4 ++++
src/test/regress/sql/constraints.sql | 5 +++++
3 files changed, 14 insertions(+), 3 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2025-10-18 21:13:45 | pgsql: Tidyup truncate_useless_pathkeys() function |
| Previous Message | Álvaro Herrera | 2025-10-18 15:54:17 | pgsql: Fix pg_dump sorting of foreign key constraints |