On Mon, Dec 1, 2025 at 11:29 AM Masahiko Sawada <[email protected]> wrote:
>
> On Thu, Nov 27, 2025 at 3:51 AM shveta malik <[email protected]> wrote:
> >
> > On Thu, Nov 27, 2025 at 2:32 AM Masahiko Sawada <[email protected]> 
> > wrote:
> > >
> > >
> > > I've squashed all fixup patches and attached the updated patch.
> > >
> >
> > Thanks for test results and the patch. Please find a few comments:
> >
> > 1)
> > If primary has effective_wal_level as logical and standby has zero
> > slots; then during promotion of standby, if I try to create a slot, it
> > is restricted as intended, but it gives misleading message:
> > postgres=# SELECT pg_create_logical_replication_slot('slot',
> > 'pgoutput', false, false, false);
> > ERROR:  logical decoding on standby requires "effective_wal_level" >=
> > "logical" on the primary
> > HINT:  Set "wal_level" >= "logical" or create at least one logical
> > slot when "wal_level" = "replica".
> >
> > One possibility is we extend the message as follows:
> > "Logical decoding on standby requires either effective_wal_level >=
> > logical on the primary or that recovery has finished." and remove
> > errhint?
>
> But the proposed message seems to contradict with its condition:
>
> if (RecoveryInProgress() && !IsLogicalDecodingEnabled())
>
> That is, logical decoding on standby is not necessarily enabled after
> recovery has finished (e.g., when it doesn't have a valid logical
> slot).

Okay, I see your point. But since this error is during creation of
slot that made me suggest the concerned message; as slot creation
completion will necessarily mean slot is present. But yes, since the
message says 'logical decoding', I understand even the proposed
message is not completely correct.

>
> If you get the error message while the standby is being promoted,
> isn't it a normal behavior given that the standby has not been fully
> promoted yet?
>

The error message kind of indicates towards the primary (old one)
which already has a slot present and thus it is misleading to say
'create at least one logical slot..'.
If by 'primary', you mean the 'standby currently under promotion i.e.
the new primary', then the current message makes sense. But it is
difficult to understand that part.

Do you have any better ideas here?
Also, since this is a very rare scenario, it’s probably acceptable to
leave it as is if no simple solution is found to address this.

thanks
Shveta


Reply via email to