summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorRobert Haas2019-03-29 12:22:49 +0000
committerRobert Haas2019-03-29 12:22:49 +0000
commit41b54ba78e8c4d64679ba4daf82e4e2efefe1922 (patch)
treed0a1d613c35305bc904174da0ee27656acdf3955 /src/backend/parser
parentc900c15269f0f900d666bd1b0c6df3eff5098678 (diff)
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
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index d711f9a7368..28f62de97e5 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -309,6 +309,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
%type <str> vac_analyze_option_name
%type <defelt> vac_analyze_option_elem
%type <list> vac_analyze_option_list
+%type <node> vac_analyze_option_arg
%type <boolean> opt_or_replace
opt_grant_grant_option opt_grant_admin_option
opt_nowait opt_if_exists opt_with_data
@@ -10543,9 +10544,9 @@ analyze_keyword:
;
vac_analyze_option_elem:
- vac_analyze_option_name
+ vac_analyze_option_name vac_analyze_option_arg
{
- $$ = makeDefElem($1, NULL, @1);
+ $$ = makeDefElem($1, $2, @1);
}
;
@@ -10554,6 +10555,11 @@ vac_analyze_option_name:
| analyze_keyword { $$ = "analyze"; }
;
+vac_analyze_option_arg:
+ opt_boolean_or_string { $$ = (Node *) makeString($1); }
+ | /* EMPTY */ { $$ = NULL; }
+ ;
+
opt_analyze:
analyze_keyword { $$ = true; }
| /*EMPTY*/ { $$ = false; }