From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | shveta malik <shveta(dot)malik(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:01:40 |
Message-ID: | aFkmBENHuhZJuMor@ip-10-97-1-34.eu-west-3.compute.internal |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On Mon, Jun 23, 2025 at 05:10:37PM +0900, Masahiko Sawada wrote:
> On Thu, Jun 19, 2025 at 6:00 PM Bertrand Drouvot
> <bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
> >
> > - pg_activate_logical_decoding() is needed only if there is not already a logical
> > slot on the primary
> > - the drop requires the user to think twice if this is the last logical slot
> > - we don't ask the user to create a logical slot if he does not want to use it
> > on the primary
> >
> > Thoughts?
>
> If there is no logical slot on the primary, how can the user disable
> logical decoding that has been enabled via
> pg_activate_logical_decoding()?
I was thinking to keep the pg_deactivate_logical_decoding() API proposed
in this thread.
> 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. 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().
Yeah that could be an idea (and then we don't add the new wal_level_action
to the drop slot command).
> We might want to have a GUC parameter
> for users to turn on/off this automatic behavior.
You mean a GUC to both automaticly set effective_wal_level to logical at slot creation
and also decrease effective_wal_level to replica if last replication slot is dropped?
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
From | Date | Subject | |
---|---|---|---|
Next Message | shveta malik | 2025-06-23 10:02:42 | Re: POC: enable logical decoding when wal_level = 'replica' without a server restart |
Previous Message | shveta malik | 2025-06-23 09:19:22 | Re: POC: enable logical decoding when wal_level = 'replica' without a server restart |