Re: VACUUM fails to parse 0 and 1 as boolean value - Mailing list pgsql-hackers

From Andres Freund
Subject Re: VACUUM fails to parse 0 and 1 as boolean value
Date
Msg-id 20190514175223.hkr7ojp5pro2pzwm@alap3.anarazel.de
Whole thread Raw
In response to VACUUM fails to parse 0 and 1 as boolean value  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: VACUUM fails to parse 0 and 1 as boolean value  (Michael Paquier <michael@paquier.xyz>)
Re: VACUUM fails to parse 0 and 1 as boolean value  (Masahiko Sawada <sawada.mshk@gmail.com>)
Re: VACUUM fails to parse 0 and 1 as boolean value  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
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.

CCing Robert and Sawada-san, who committed / authored that code.

commit 41b54ba78e8c4d64679ba4daf82e4e2efefe1922
Author: Robert Haas <rhaas@postgresql.org>
Date:   2019-03-29 08:22:49 -0400

    Allow existing VACUUM options to take a Boolean argument.
    
    This makes VACUUM work more like EXPLAIN already does without changing
    the meaning of any commands that already work.  It is intended to
    facilitate the addition of future VACUUM options that may take
    non-Boolean parameters or that default to false.
    
    Masahiko Sawada, reviewed by me.
    
    Discussion: http://postgr.es/m/CA+TgmobpYrXr5sUaEe_T0boabV0DSm=utSOZzwCUNqfLEEm8Mw@mail.gmail.com
    Discussion: http://postgr.es/m/CAD21AoBaFcKBAeL5_++j+Vzir2vBBcF4juW7qH8b3HsQY=Q6+w@mail.gmail.com

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: VACUUM fails to parse 0 and 1 as boolean value
Next
From: Fujii Masao
Date:
Subject: Re: vacuumdb and new VACUUM options