Re: BUG #19884: pg_publication_tables omits a detach-pending partition in root mode

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
Cc: 1548140642(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: BUG #19884: pg_publication_tables omits a detach-pending partition in root mode
Date: 2026-11-13 04:42:53
Message-ID: CABdArM7GM1zVHF0EX8upBbuOPZx2idJQp=XTaVF6=bKcH-QKBQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Nov 13, 2026 at 3:16 AM Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com> wrote:
>
>
>
> чт, 12 нояб. 2026 г. в 22:16, PG Bug reporting form <noreply(at)postgresql(dot)org>:
>>
>> The following bug has been logged on the website:
>>
>> Bug reference: 19884
>> Logged by: Milo
>> Email address: 1548140642(at)qq(dot)com
>> PostgreSQL version: 18.6
>> Operating system: Linux/amd64
>> Description:
>>
>> After phase one of ALTER TABLE ... DETACH PARTITION CONCURRENTLY,
>> pg_publication_tables omits the detach-pending child from an ALL TABLES
>> publication when publish_via_partition_root is enabled. At that point the
>> child has no ancestors and is treated as a standalone relation for
>> publication purposes, so it should appear in the view. The query instead
>> returns zero rows.
>>
>>
>
> Hi Milo!
>
> Thanks for the report.
>
> I was also able to reproduce the problem on the master branch.
>
> I think we can fix this by using get_partition_ancestors() in pg_get_publication_tables().
> After the pending detach commits, that list is empty, so the table stays in the publication.
>
> Patch in attachment.
>

Thanks for the report and the patch. This appears to be the same issue
reported in [1]. Patch v2-0003 shared in [2] fixes it for ALL TABLES
publications, and also for the EXCEPT case, which is affected by the
same root cause.

[1] https://www.postgresql.org/message-id/CAN4CZFOxn6rv52YJRXE56sUx5iB-njB854o9jYLx2e-wO9hiAA%40mail.gmail.com
[2] https://www.postgresql.org/message-id/CADzfLwU97r3QC5oZDeVcWvcvXhNy9VnoFNDVHw%2BERg_DEG4%3DFQ%40mail.gmail.com

--
Thanks,
Nisha

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Nitin Motiani 2026-11-13 04:33:21 Re: BUG #19737: Empty `JSON_OBJECT` cannot use documented `ON NULL` or unique-key clauses