Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kST1o-0002dG-Bp for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2020 22:44:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kST1n-0006E7-71 for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2020 22:44:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kST1l-0006E0-VU for pgsql-hackers@lists.postgresql.org; Tue, 13 Oct 2020 22:44:19 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kST1j-0001Gp-2y for pgsql-hackers@postgresql.org; Tue, 13 Oct 2020 22:44:17 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 3390810B9; Tue, 13 Oct 2020 18:44:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 13 Oct 2020 18:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=GeIIyyu+iNoTWbSvY crJpFY0r33zsho+LN9BtzQg13s=; b=YztjkW5vsDIeFY63FbuhllJnN+YUn06X6 JJkMeMIzsXU7mEquI6jJK+Cf3h2BszKxUjhhyzGpPhgpvHxXw1Rh337Q9ZpvTZAj Oj1/4exIsbdjMGsMK9Clq+mlGiyvlbRnqzTrmxSacfUf6LVDm7j+eeTy8j73ly64 R/de3VhHGk5+Kn74dMxwBaVrzkROQn7iUyZaS1mALcZNA/4Gu4jCeSz0NfxLM7Jv /95XDlKGTlie97Q26FHVxZwvskmnCk8w6av5fck1+m/RhlaeYVoQbkPFKIcb1F3M 476l4t1i+VkfeudsypgcabsqdpAAHV64ulaZ+BGbZkVAogN+svInw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedriedtgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtuggjfgesthdtredttdervdenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepvefgleevgeeujeeghfegteeghfegheeifeehheelteetiedu ieeihffggfehffetnecukfhppeduledtrdelhedrudelrddugeeknecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 259BB3280060; Tue, 13 Oct 2020 18:44:11 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id DEC332A14F1; Tue, 13 Oct 2020 19:44:08 -0300 (-03) Date: Tue, 13 Oct 2020 19:44:08 -0300 From: Alvaro Herrera To: Masahiko Sawada Cc: "Drouvot, Bertrand" , PostgreSQL-development Subject: Re: Add Information during standby recovery conflicts Message-ID: <20201013224408.GA5517@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.