Re: Allow logical replication in the same cluster - Mailing list pgsql-hackers

From Chao Li
Subject Re: Allow logical replication in the same cluster
Date
Msg-id E59926B2-C3C1-4980-9180-77749B986021@gmail.com
Whole thread Raw
In response to Re: Allow logical replication in the same cluster  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Hi Amit,

Thanks for your info.

On Sep 6, 2025, at 12:32, Amit Kapila <amit.kapila16@gmail.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/




pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Should io_method=worker remain the default?
Next
From: jian he
Date:
Subject: let ALTER TABLE DROP COLUMN drop whole-row referenced object