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

From Fujii Masao
Subject Re: [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()
Date
Msg-id CAHGQGwFjWV6qAr1sr43PQkXdqBL3N+h3ybvuwaJ=oV=6=ku4+w@mail.gmail.com
Whole thread Raw
In response to [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()  (Joshua Shanks <jjshanks@gmail.com>)
Responses Re: [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()
List pgsql-hackers
On Sun, Nov 9, 2025 at 5:21 AM Joshua Shanks <jjshanks@gmail.com> wrote:
>
> Hi,
>
> The recent patch for passwordFromFile() error handling highlighted that many other out-of-memory error messages in
libpqstill aren't wrapped with libpq_gettext(). 
>
> Attached is a patch that systematically wraps the remaining bare "out of memory" strings across libpq with
libpq_gettext()to ensure consistent translation support. This covers: 
> - Authentication modules (fe-auth.c, fe-auth-scram.c, fe-auth-oauth.c)
> - Connection handling (fe-connect.c, fe-cancel.c)
> - Protocol and secure communication (fe-protocol3.c, fe-secure-*.c)
> - Other modules (fe-exec.c, fe-lobj.c, fe-gssapi-common.c)

- libpq_append_conn_error(conn, "out of memory");
+ libpq_append_conn_error(conn, libpq_gettext("out of memory"));

Seems libpq_gettext() doesn't need to be called here,
since libpq_append_conn_error() already does that internally. No?

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: schema variables
Next
From: Fujii Masao
Date:
Subject: Re: display hot standby state in psql prompt