Re: Fix bug of CHECK constraint enforceability recursion - Mailing list pgsql-hackers

From jian he
Subject Re: Fix bug of CHECK constraint enforceability recursion
Date
Msg-id CACJufxGgSKFGWja=JPv3-zq3whON5cESLp7Z5=OsYvZOaRGnGw@mail.gmail.com
Whole thread
In response to Re: Fix bug of CHECK constraint enforceability recursion  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Fix bug of CHECK constraint enforceability recursion
List pgsql-hackers
On Tue, Jun 2, 2026 at 2:40 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
> Oops! I just found that I forgot to commit a tiny comment tuning in 0001. So posting v6.
>
Hi.

One partition cannot have two direct parent tables. see
ATExecAttachPartition comment:
/* A partition can only have one parent */

Also
CREATE TABLE ... PARTITION OF automatically copies the parent
constraint definition, and
ALTER TABLE ... ATTACH PARTITION already rejects cases where the
parent is enforced but the child is not.

Therefore, I think calling ATCheckCheckConstrHasEnforcedParent once is
enough for partition inheritance.

Also please check the attached minor refactoring.



--
jian
https://www.enterprisedb.com/

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: Reject HEADER with binary and json COPY formats by option presence
Next
From: Chao Li
Date:
Subject: Fix \crosstabview to honor \pset display_true/display_false