Re: [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Joshua Shanks <jjshanks(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()
Date: 2025-11-11 02:03:22
Message-ID: aRKZaiQ9AZhECwgW@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 10, 2025 at 05:21:00PM -0800, Joshua Shanks wrote:
> You're absolutely right, thank you for catching that! I was
> double-wrapping the translation.
>
> libpq_append_conn_error() already calls libpq_gettext()
> internally (fe-misc.c:1420), so these changes are unnecessary. I'm
> withdrawing this patch.

Following a bit here, as I'm sure that this thread comes from
861af9261035.

The reason behind the additions of the two libpq_gettext() in
passwordFromFile(), as done in 861af9261035, is just to provide a
safety net in case we introduce a new caller of passwordFromFile()
that forgets to apply gettext(), with for example a new message
printed to stderr. Not mandatory for these two new cases as
libpq_append_conn_error() is called shortly after grabbing the error
message grabbed for the current caller of passwordFromFile(), still
better to have in the long-run, IMO. That's also the style we've
adopted for the error messages related to the protocol or fe-exec.c.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rohit Prasad 2025-11-11 02:06:14 Re: Include extension path on pg_available_extensions
Previous Message Jonathan S. Katz 2025-11-11 01:57:32 Re: 2025-11-13 release announcement draft