Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: VACUUM (PARALLEL) option processing not using DefElem the way it was intended
Date: 2025-10-08 16:33:40
Message-ID: CAD21AoAgiJTZw3bK+puGBj=5uR4GnDEd-j5Z=baAhn3Z+y3KHA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 8, 2025 at 7:01 AM Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> On 2025-Oct-09, David Rowley wrote:
>
> > On Thu, 9 Oct 2025 at 00:36, Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
> > > Yeah, that change makes sense to me. With an eye towards not forcing
> > > the translators to understand the message context or forced to translate
> > > the word "parallel", I would suggest to take the option name out of the
> > > sentence, maybe something like
> > >
> > > value for VACUUM option \"%s\" must be between 0 and %d
> >
> > Just looking at the other error messages. They all seems to put the
> > option in upper case but not in quotes. Following along with those,
> > we'd end up with:
> >
> > PARALLEL option must be between 0 and %d
> >
> > Would that be enough to help the translator understand not to
> > translate the option name?
>
> This works for me, yeah. Though I'd still do "%s option must be between
> 0 and %d" (ie. make the option a separate string) and then they don't
> need to understand that -- and also if there's another option elsewhere
> whose value needs to be "between 0 and %d", then this string can be
> reused.

+1 to using "%s" instead of hardcoding "PARALLEL" in the message.

I noticed we're currently hardcoding the "BUFFER_USAGE_LIMIT" option
name in the error message:

ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("BUFFER_USAGE_LIMIT option must be 0 or between %d kB
and %d kB",
MIN_BAS_VAC_RING_SIZE_KB, MAX_BAS_VAC_RING_SIZE_KB),
hintmsg ? errhint("%s", _(hintmsg)) : 0));

Should we also change this for consistency with how we handle other
VACUUM options?

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-10-08 16:41:34 Re: plpython: Remove support for major version conflict detection
Previous Message Tomas Vondra 2025-10-08 16:24:33 Re: Should we update the random_page_cost default value?