Re: BUG #19807: CHECK constraint not enforced on partitioned table

From: Joao Rito <joaovictor(dot)rito(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19807: CHECK constraint not enforced on partitioned table
Date: 2026-11-14 21:33:45
Message-ID: 20261114213345.227-1-joaovictor.rito@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Dilip,

I tested v1 on current master (206e719, cassert, tap tests) and it applies cleanly. With constraint_exclusion=on, "WHERE NOT (f3 > 30)" and "WHERE f3 IS NULL" on the parent returned 0 rows before the patch. After the patch they return (12, 24) and (10, NULL), and the plan scans gp2. The result also holds after a pg_dump and restore. The regress suite passes (243 subtests) and I saw no assertion failures in the server log.

What I did not test: the isolation and tap suites, pgindent, the docs, and a CHECK constraint with a whole-row reference (my attempt failed at DDL time, so I could not tell).

Small points: the line with TupleDescAttr(...) is longer than 80 columns, and the test could add a direct scan of the partition (include_noinherit true) to show that its own constraints are still used. Do you think the INSERT and trigger WHEN cases from the report need a separate follow-up?

Regards,
Joao Rito

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Joao Rito 2026-11-14 21:33:56 Re: Two issues with REFRESH MATERIALIZED VIEW CONCURRENTLY
Previous Message Zsolt Parragi 2026-11-14 14:22:44 Re: BUG #19897: Recovery fails after "LOG: consistent recovery state reached"