pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Drouvot, Bertrand <bdrouvot@amazon.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Add Information during standby recovery conflicts
Date: Tue, 13 Oct 2020 19:44:08 -0300
Message-ID: <20201013224408.GA5517@alvherre.pgsql> (raw)
In-Reply-To: <CA+fd4k7PhTtN9D5gfi8y2DEHVBawue7vvuEK9d5XUHrp5tD7gg@mail.gmail.com>

On 2020-Oct-14, Masahiko Sawada wrote:

> I've attached the patch as an idea of fixing the above comments as
> well as the comment from Alvaro. I can be applied on top of v4 patch.

One note about the translation stuff.  Currently you have _("...") where
the string is produced, and then ereport(.., errmsg("%s", str) where it
is used.  Both those things will attempt to translate the string, which
isn't great.  It is better if we only translate once.  You have two
options to fix this: one is to change _() to gettext_noop() (which marks
the string for translation so that it appears in the message catalog,
but it does not return the translation -- it returns the original, and
then errmsg() translates at run time).  The other is to change errmsg()
to errmsg_internal() .. so the function returns the translated message
and errmsg_internal() doesn't apply a translation.

I prefer the first option, because if we ever include a server feature
to log both the non-translated message alongside the translated one, we
will already have both in hand.





view thread (82+ messages)  latest in thread

Message-ID: <20201013224408.GA5517@alvherre.pgsql>
Permalink:  ../20201013224408.GA5517@alvherre.pgsql/
Also on:    postgresql.org/message-id/20201013224408.GA5517@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, masahiko.sawada@2ndquadrant.com, bdrouvot@amazon.com
  Subject: Re: Add Information during standby recovery conflicts
  In-Reply-To: <20201013224408.GA5517@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox