> On Jun 3, 2026, at 14:58, jian he <[email protected]> wrote: > > On Tue, Jun 2, 2026 at 2:40 PM Chao Li <[email protected]> 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 before the 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/
v6-0001-Prevent-inherited-CHECK-constraints-from-being-we.patch
Description: Binary data
v6-0002-doc-Clarify-inherited-constraint-behavior.patch
Description: Binary data
v6-0003-doc-Clarify-ALTER-CONSTRAINT-enforceability-behav.patch
Description: Binary data
