Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Masahiko Sawada <sawada.mshk@gmail.com>
From: Masahiko Sawada <sawada.mshk@gmail.com>
To: Shlok Kyal <shlok.kyal.oss@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Amit Kapila <amit.kapila16@gmail.com>, Bertrand Drouvot <bertranddrouvot.pg@gmail.com>,
shveta malik <shveta.malik@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-08-29T18:29:14Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix regression test failure when wal_level is set to minimal.
- 0de5f0d869d1 19 (unreleased) landed
-
Toggle logical decoding dynamically based on logical slot presence.
- 67c20979ce72 19 (unreleased) landed
-
Disallow server start with sync_replication_slots = on and wal_level < logical.
- 12da45742cfd 19 (unreleased) cited
On Fri, Aug 29, 2025 at 2:46 AM Shlok Kyal <shlok.kyal.oss@gmail.com> wrote: > > Hi Sawada-san, > > Thanks for the updated patch. > > I have a doubt. When we create publication (when wal_level is set to > replica) we get a warning: > WARNING: logical decoding needs to be enabled to publish logical changes > HINT: Before creating subscriptions, set "wal_level" >= "logical" or > create a logical replication slot when "wal_level" = "replica". > > The hint suggests that when wal_level = 'replica', before creating a > subscription, we should create logical slots on the publisher. But > when I tested this scenario, I created a subscription (without having > a prior logical slot on the publisher). The operation was successful, > the effective_wal_level was set appropriately and logical replication > was working fine. I think this happens because the CREATE SUBSCRIPTION > command itself creates a logical slot on the publisher. > > Should we update the HINT message here? Thank you for the comment! I believe the point is whether to hint that creating a subscription is a third way to enable logical decoding. I'm concerned that it could be redundant as CREATE SUBSCRIPTION with create_slot=true actually creates the logical slot as you mentioned, and we already mentioned it. If we add it to the hink, we would have to mention it as well when we have commands in the future that internally creates a logical slot. I think that it's prudent to mention the minimum requirement to enable logical decoding in the hint. Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com