Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Date: 2025-06-23 10:02:42
Message-ID: CAJpy0uCAYbnMhL++LjKgG=Xc15oZy+HfdQE1zYVCDCDxbOEd3g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 23, 2025 at 1:41 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> Given the discussion so far, it seems we might want to have a
> safeguard to prevent the effective_wal_level from being dropped to
> 'replica' if the last logical slot is accidentally dropped.

Yes, needed for cases where standby or cascaded standbys have
requirements of logical decoding.

> Another
> idea we can consider is that we automatically increase
> effective_wal_level to 'logical' upon the logical slot creation but
> don't automatically decrease it when dropping the last slot. To
> decrease the effective_wal_level to 'replica', users would need to do
> that explicitly for example using a SQL function,
> pg_disable_logical_decoding().

Okay. Seems a good solution so far.

> We might want to have a GUC parameter
> for users to turn on/off this automatic behavior.
>

Yes. Agreed.

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-06-23 10:42:32 Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Previous Message Bertrand Drouvot 2025-06-23 10:01:40 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart