Re: Miscellaneous message fixes - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Miscellaneous message fixes
Date
Msg-id aYurQ_SLbysSvD0n@paquier.xyz
Whole thread Raw
In response to Re: Miscellaneous message fixes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Miscellaneous message fixes
List pgsql-hackers
On Tue, Feb 10, 2026 at 09:55:23AM -0500, Tom Lane wrote:
> Yeah, this code is simply wrong.  You should remove the
> quote_identifier() calls and otherwise leave it as-is.
>
> quote_identifier(), quote_qualified_identifier(), etc are meant for
> building valid SQL strings.  However, an error message is a totally
> different animal.  We decided years ago that the preferred style is
> to wrap "..." around the unadorned identifier *in the error text*,
> not by using quote_identifier(), so that translators could replace
> the double-quote marks with appropriate marks for their language.
> Is the English version 100% consistent in the presence of identifiers
> containing double-quote marks?  No.  But we'd be making matters
> worse not better for other languages if we did it differently.

Right, I had a brain fart on this one.  Using "%s"."%s" where the
namespace and object names were independently quoted is also not
project style.  At the end, I have removed the quote_identifier()
calls altogether, and reduced the number of quotes in the error
strings, leading to f33c58577422 as a result.  If there is anything
else, please let me know.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Add GoAway protocol message for graceful but fast server shutdown/switchover
Next
From: "Euler Taveira"
Date:
Subject: Re: log_min_messages per backend type