Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: shveta malik <shveta.malik@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>,
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-10-23T04:48:37Z
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 Thu, Oct 23, 2025 at 8:58 AM Peter Smith <smithpb2250@gmail.com> wrote: > > On Wed, Oct 22, 2025 at 8:28 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > On Wed, Oct 22, 2025 at 2:40 PM shveta malik <shveta.malik@gmail.com> wrote: > > > > > > On Fri, Oct 17, 2025 at 11:09 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > > > > > > > I want to discuss the create-publication case, which currently gives > > > this warning: > > > > > > postgres=# create publication pub1 for all tables; > > > WARNING: logical decoding should be allowed to publish logical changes > > > HINT: Before creating subscriptions, set "wal_level" >= "logical" or > > > create a logical replication slot when "wal_level" = "replica". > > > CREATE PUBLICATION > > > > > > But is this warning really necessary during publication creation? > > > > > > > On HEAD, the WARNING/HINT is as follows for the above case: > > WARNING: "wal_level" is insufficient to publish logical changes > > HINT: Set "wal_level" to "logical" before creating subscriptions. > > > > Shouldn't we simply change the HINT to "Set "wal_level" to "logical" > > or create a logical replication slot before creating subscriptions."? > > > > I had suggested in a previous review [1-#6b] that perhaps this HINT > wording is overkill now. e.g. I felt now maybe it only needs to say. > HINT: Set "wal_level" >= "replica". > > E.g. I thought there is no need to mention "create a logical slot > before creating subscriptions", because creating a typical > subscription (which has a slot) is doing that anyway, so the > publisher's effective_wal_level will increase on the fly, without the > user needing to do anything. > > At least, that is what I observed with the experiment shown below: > > Indeed, doesn't it mean this entire WARNING is redundant now? e.g. > When wal_level is "minimal", I thought the CREATE PUBLICATION command > would be impossible in the first place. > We can create a publication at wal_level=minimal as well. See: postgres=# create publication pub1 for table t1; WARNING: "wal_level" is insufficient to publish logical changes HINT: Set "wal_level" to "logical" before creating subscriptions. CREATE PUBLICATION postgres=# show wal_level; wal_level ----------- minimal (1 row) So, we still need a WARNING message here though the wording could be different than what we have now. -- With Regards, Amit Kapila.