Re: Minimal logical decoding on standbys - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Minimal logical decoding on standbys
Date
Msg-id 20230403153452.32cw4tslgdp5m4dq@alvherre.pgsql
Whole thread Raw
In response to Re: Minimal logical decoding on standbys  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
Responses Re: Minimal logical decoding on standbys  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2023-Apr-03, Drouvot, Bertrand wrote:

> +/*
> + * Report terminating or conflicting message.
> + *
> + * For both, logical conflict on standby and obsolete slot are handled.
> + */
> +static void
> +ReportTerminationInvalidation(bool terminating, bool islogical, int pid,
> +                              NameData slotname, TransactionId *xid,
> +                              XLogRecPtr restart_lsn, XLogRecPtr oldestLSN)
> +{

> +    if (terminating)
> +        appendStringInfo(&err_msg, _("terminating process %d to release replication slot \"%s\""),
> +                         pid,
> +                         NameStr(slotname));
> +    else
> +        appendStringInfo(&err_msg, _("invalidating"));
> +
> +    if (islogical)
> +    {
> +        if (terminating)
> +            appendStringInfo(&err_msg, _(" because it conflicts with recovery"));

You can't build the strings this way, because it's not possible to put
the strings into the translation machinery.  You need to write full
strings for each separate case instead, without appending other string
parts later.

Thanks

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Minimal logical decoding on standbys
Next
From: Dave Cramer
Date:
Subject: Re: Request for comment on setting binary format output per session