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-11-01 15:56:54
Message-ID: b486fad0-beba-445a-9461-b035be42026b@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-10-30 Fr 5:43 PM, Andrew Dunstan wrote:
>
> 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.
>
>
>

Done.

cheers

andrew

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-11-01 16:14:28 Re: Internal error codes triggered by regression tests and user queries, take 2
Previous Message Fujii Masao 2026-11-01 15:31:19 Re: Incremental backup can use a summary past a timeline switch