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 <rh...@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=utsozzwcunqfleem...@mail.gmail.com Discussion: http://postgr.es/m/CAD21AoBaFcKBAeL5_++j+Vzir2vBBcF4juW7qH8b3HsQY=q...@mail.gmail.com Greetings, Andres Freund