Re: Minimal logical decoding on standbys

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>, fabriziomello(at)gmail(dot)com, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: Minimal logical decoding on standbys
Date: 2023-04-03 19:23:14
Message-ID: 20230403192314.zhvezybsjesx7or4@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-04-03 17:34:52 +0200, Alvaro Herrera wrote:
> 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.

Hm? That's what the _'s do. We build strings in parts in other places too.

You do need to use errmsg_internal() later, to prevent that format string from
being translated as well.

I'm not say that this is exactly the right way, don't get me wrong.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2023-04-03 19:40:42 Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Previous Message Peter Geoghegan 2023-04-03 19:20:01 Re: Pass heaprel to GlobalVisTestFor() in vacuumRedirectAndPlaceholder()