On Fri, Dec 12, 2025 at 9:28 AM Chao Li <[email protected]> wrote: > > Hi Amit, > > Thanks for pointing out that my assumption of “RI of parent is not used” is > not always true. > > I agree that automatic-cascade will introduce a lot of complexities. To > ensure the backward-compatibility, how about to extend the ALTER TABLE syntax > like: > > ``` > ALTER TABLE <root> REPLICA IDENTITY <type> [CASCADE | FORCE CASCADE] > ``` >
CASCADE is used for dependent objects, so I don't think using it will be appropriate in this context. However, the INHERIT (NO INHERIT) could be used. We already use them for constraints, see ALTER TABLE ... ALTER CONSTRAINT syntax in docs. > So, that the current syntax will behave the same as usual, and > > With CASCADE > ============ > 1. Root's RI updated > 2. All children (including middle partitioned tables and leaf tables) RI > updated unless 3 > 3. If any child’s RI is different from the root's RI, fail out, no change > happens > > With CASCADE FORCE > =================== > 1. Root's RI updated > 2. All children (including middle partitioned tables and leaf tables) RI > updated, prints a warning message when a child’s RI is different from root’s > RI > I think you can try to experiment with CHECK or NOT NULL constraint behavior for similar cases in case of partition tables. BTW, did you get this use case in the field or just browsing docs, you thought it would be useful to have such a feature? -- With Regards, Amit Kapila.
