Re: Support EXCEPT for TABLES IN SCHEMA publications

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications
Date: 2026-07-16 06:15:13
Message-ID: CAJpy0uAdF3K0QDANkT2HgiMzPzOpHKiMXQsM8bZfaaaCKYfxtQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 16, 2026 at 11:14 AM Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> A zero-row result indicates the INSERT wasn't decoded, so seems
> get_rel_sync_entry() wasn't reached. Sorry for the ambiguous test
> steps -- the slot creation order matters.
> Please follow these steps to reproduce the issue on HEAD:
>
> Session1:
> CREATE TABLE t1 (a int) PARTITION BY RANGE (a);
> CREATE TABLE t1_part PARTITION OF t1 FOR VALUES FROM (1) TO (100);
> CREATE PUBLICATION mypub FOR ALL TABLES;
> SELECT pg_create_logical_replication_slot('myslot', 'pgoutput');
>
> Session 2:
> BEGIN;
> SELECT * FROM t1;
> -- leave open
>
> Session 3 (hangs):
> ALTER TABLE t1 DETACH PARTITION t1_part CONCURRENTLY;
>
> Session 4, while 3 is blocked:
> INSERT INTO t1_part VALUES (5);
> SELECT * FROM pg_logical_slot_get_binary_changes('myslot', NULL,
> NULL, 'proto_version', '1', 'publication_names', 'mypub');
>

Okay thanks. I am able to reproduce the crash on HEAD now. We can
pursue this in separate thread. I am not immediately clear on the
solution yet. I think this is introduced by:
https://www.postgresql.org/message-id/E1lPX7q-0001lJ-NO%40gemulon.postgresql.org

it seems 'get_partition_parent' is changed to accept an arguement
'even_if_detached' to control whether caller wants detached partition
or should error-out but no such arguement in
get_partition_ancestors(). We can discuss this in separate thread.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-07-16 06:19:31 Fix RETURNING side effects for FOR PORTION OF leftover rows
Previous Message Ajin Cherian 2026-07-16 06:06:23 Re: [PATCH] Preserve replication origin OIDs in pg_upgrade