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

From: Joshua Shanks <jjshanks(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] libpq: Wrap out-of-memory error messages with libpq_gettext()
Date: 2025-11-11 01:21:00
Message-ID: CAOxqWDe6j1m2LHzh_CKNNWzaryHksgpM9N9kerCOqpgSAdF-yQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

On Sun, Nov 9, 2025 at 11:04 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> On Sun, Nov 9, 2025 at 5:21 AM Joshua Shanks <jjshanks(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > The recent patch for passwordFromFile() error handling highlighted that
> many other out-of-memory error messages in libpq still 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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-11-11 01:43:42 Re: Sequence Access Methods, round two
Previous Message David Rowley 2025-11-11 00:58:22 Re: another autovacuum scheduling thread