> On Jun 3, 2026, at 14:58, jian he <jian.universality@gmail.com> wrote:
>
> 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.
This is a good point. I addressed it in v6.
>
> Also please check the attached minor refactoring.
>
I accepted the refactoring with a small tuning. When we pull up changing_conids = list_make1_oid(currcon->oid); to
beforethe for loop, we also need to check if (!cmdcon->is_enforced). I also updated the comment accordingly.
>
> --
> jian
> https://www.enterprisedb.com/
> <checkconstr_inheritance_issue.nocfbot>
Also, thanks for attaching the diff, which made me easy to view your refactoring by applying the diff to my patch
branch.
PFA v6: 0002 and 0003 unchanged. 0001 addressed the two comments from Jian.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/