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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: jian he <jian(dot)universality(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 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-30 21:43:27
Message-ID: 2a07dba2-43c9-4acd-b124-165247d353ea@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-10-29 Th 1:05 AM, jian he wrote:
> To summarize where this thread:
>
> v5-0001 is a fix for PG19.
>
> v5-0002 and v5-0003 fix the problem for PG18 as well. However, they
> require us to accept that pg_dump may restore a child's inherited CHECK
> constraint with pg_constraint.conislocal = true, even though it was false
> in the original database.
> The visible consequence is that, after a
> restore, ALTER TABLE ... DROP CONSTRAINT on the parent no longer drops the
> child's copy of the constraint; the child keeps it as a local constraint.
> (Given table inheritance is not liked by many people, maybe it's OK to
> change conislocal for table inheritance, but not partitioning
> inheritance)
>
>

Yeah, I'm going to commit patch 0001, which is pretty straightforward,
to close the pg19 open item, and leave the remaining items for later
discussion.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-10-30 21:56:14 Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation
Previous Message Bryan Green 2026-10-30 21:38:21 [PATCH] Add an ETW backend for the static probes on Windows