Hi jian, Here is v5. 0001 and 0002 are your v4. 0003 dumps the child's ENFORCED CHECK as local when no parent enforces it, as you suggested.
0003 skips NOT VALID constraints. Restoring one would mark it valid without a scan, the merge bug in Nikolay's thread [1]. Your convalidated case goes back to 14. Could you post it as its own patch? I am happy to review. Thanks, Shihao [1] https://www.postgresql.org/message-id/flat/CAM527d8qCH4q1xV-TftDmm3eBcBie9AxfdTtThPUoGWnYT08gw%40mail.gmail.com
v5-0001-Reject-enforcing-a-parent-CHECK-over-a-NOT-VALID-.patch
Description: Binary data
v5-0002-pg_dump-keep-ENFORCED-on-a-child-s-inherited-CHEC.patch
Description: Binary data
v5-0003-pg_dump-keep-ENFORCED-on-a-child-s-CHECK-that-no-.patch
Description: Binary data
