Re: Allow logical replication in the same cluster

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: Allow logical replication in the same cluster
Date: 2025-09-08 02:49:44
Message-ID: E59926B2-C3C1-4980-9180-77749B986021@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit,

Thanks for your info.

> On Sep 6, 2025, at 12:32, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> You can avoid this problem by creating a slot first on publisher with
> something like:
> postgres=# select pg_create_logical_replication_slot('s1', 'pgoutput',
> false, true);
> pg_create_logical_replication_slot
> ------------------------------------
> (s1,0/01BFF178)
> (1 row)
>
> Then while creating subscription you can use the above created slot as follows:
> db1=# create subscription sub1 connection 'dbname=postgres'
> publication pub1 WITH(create_slot=false, slot_name='s1');
> CREATE SUBSCRIPTION
>
> --
> With Regards,
> Amit Kapila.

I am aware of this workaround solution. When I encountered the “create subscription” stuck problem, I did a Google search, then I found the old discussion thread that mentioned a workaround, so I did further search and eventually figured out the workaround.

I think it’s worth resolving this issue, because it avoids confusion from people who want to try or test logical replication logically, and allows the same script to run in both an pure local environment and a real non-local environment. WDYT?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-09-08 02:53:00 let ALTER TABLE DROP COLUMN drop whole-row referenced object
Previous Message Thomas Munro 2025-09-08 02:44:57 Re: Should io_method=worker remain the default?