| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions |
| Date: | 2025-12-13 11:10:46 |
| Message-ID: | CAA4eK1JbyjxbL09-9KDNonFtG_GA54+wz00SZGyzNRTLaCv-Ag@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Fri, Dec 12, 2025 at 9:28 AM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> 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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sami Imseih | 2025-12-13 13:48:20 | Re: Support named (destination) portals in extended proto for psql meta commands. |
| Previous Message | Alexander Lakhin | 2025-12-13 11:00:00 | Re: Making jsonb_agg() faster |