Fix pg_dump for inherited validated not-null constraints

When a child constraint is validated and the parent constraint it
derives from isn't, pg_dump must be coerced into printing the child
constraint; failing to do would result in a dump that restores the
constraint as not valid, which would be incorrect.

Co-authored-by: jian he <jian.universal...@gmail.com>
Co-authored-by: Álvaro Herrera <alvhe...@kurilemu.de>
Reported-by: jian he <jian.universal...@gmail.com>
Message-id: 
https://postgr.es/m/CACJufxGHNNMc0E2JphUqJMzD3=bwrsuaevbf5ekgkg8uy0q...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0e13b13d26e870cb18fe6ecf9f8697ddfcf2c740

Modified Files
--------------
src/bin/pg_dump/common.c                  | 26 ++++++++++++--
src/bin/pg_dump/pg_dump.c                 | 20 ++++++++---
src/bin/pg_dump/pg_dump.h                 |  1 +
src/bin/pg_dump/t/002_pg_dump.pl          | 59 +++++++++++++++++++++++++++++--
src/test/regress/expected/constraints.out | 34 ++++++++++++++++++
src/test/regress/sql/constraints.sql      | 18 ++++++++++
6 files changed, 149 insertions(+), 9 deletions(-)

Reply via email to