Re: VACUUM fails to parse 0 and 1 as boolean value

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: VACUUM fails to parse 0 and 1 as boolean value
Date: 2019-05-16 18:56:17
Message-ID: CAHGQGwG36ZDsc0YJKDOK-kaJ+ed-XrVOKZHRGcfmZ+DVBBhJ_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 15, 2019 at 2:52 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Hi,
>
> On 2019-05-15 02:45:21 +0900, Fujii Masao wrote:
> > VACUUM fails to parse 0 and 1 as boolean value
> >
> > The document for VACUUM explains
> >
> > boolean
> > Specifies whether the selected option should be turned on or off.
> > You can write TRUE, ON, or 1 to enable the option, and FALSE, OFF,
> > or 0 to disable it.
> >
> > But VACUUM fails to parse 0 and 1 as boolean value as follows.
> >
> > =# VACUUM (INDEX_CLEANUP 1);
> > ERROR: syntax error at or near "1" at character 23
> > STATEMENT: VACUUM (INDEX_CLEANUP 1);
> >
> > This looks a bug. The cause of this is a lack of NumericOnly clause
> > for vac_analyze_option_arg in gram.y. The attached patch
> > adds such NumericOnly. The bug exists only in 12dev.
> >
> > Barring any objection, I will commit the patch.
>
> Might be worth having a common rule for such options, so we don't
> duplicate the knowledge between different places.

Yes. Thanks for the comment!
Attached is the updated version of the patch.
It adds such common rule.

Regards,

--
Fujii Masao

Attachment Content-Type Size
vacuum_numeric_as_boolean_v2.patch application/octet-stream 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-05-16 19:08:06 Re: PostgreSQL 12: Feature Highlights
Previous Message Bruce Momjian 2019-05-16 18:26:28 Re: PostgreSQL 12: Feature Highlights