]> granicus.if.org Git - postgresql/commitdiff
Make VACUUM accept 1 and 0 as a boolean value.
authorFujii Masao <fujii@postgresql.org>
Mon, 20 May 2019 15:22:06 +0000 (00:22 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 20 May 2019 15:23:16 +0000 (00:23 +0900)
Commit 41b54ba78e allowed existing VACUUM options to take a boolean
argument. It's documented that valid boolean values that VACUUM can
accept are true, false, on, off, 1, and 0. But previously the parser
failed to accept 1 and 0 as a boolean value in VACUUM syntax because
of a lack of NumericOnly clause for vac_analyze_option_arg in gram.y.

This commit adds such NumericOnly clause so that VACUUM options
can take also 1 and 0 as a boolean value.

Discussion: https://postgr.es/m/CAHGQGwGYg82A8UCQxZe7Zn9MnyUBGdyB=1CNpKF3jBny+RbyfA@mail.gmail.com

src/backend/parser/gram.y

index 3dc0e8a4fbc3a64de65c469c3ad6876379d75505..8311b1dd467dea00a5d1bd1b0a593aff29faecd4 100644 (file)
@@ -10583,6 +10583,7 @@ vac_analyze_option_name:
 
 vac_analyze_option_arg:
                        opt_boolean_or_string                                   { $$ = (Node *) makeString($1); }
+                       | NumericOnly                   { $$ = (Node *) $1; }
                        | /* EMPTY */                                                   { $$ = NULL; }
                ;