Re: [PG19] Three bugs with a CHECK constraint that only the child enforces

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Nikolay Samokhvalov <nik(at)postgres(dot)ai>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Subject: Re: [PG19] Three bugs with a CHECK constraint that only the child enforces
Date: 2026-10-24 04:00:00
Message-ID: CAGRkXqSnu-sUZQK9CB8K-cLbRQ45wLpC79wC2NuiRfL_0su-xQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v5-0001-Reject-enforcing-a-parent-CHECK-over-a-NOT-VALID-.patch application/octet-stream 6.8 KB
v5-0002-pg_dump-keep-ENFORCED-on-a-child-s-inherited-CHEC.patch application/octet-stream 9.9 KB
v5-0003-pg_dump-keep-ENFORCED-on-a-child-s-CHECK-that-no-.patch application/octet-stream 5.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-24 04:05:25 [PG19] pg_upgrade --check passes, then the upgrade fails
Previous Message shihao zhong 2026-10-24 03:48:21 Re: Wrong results from a parameterized Append