We now have several syntax elements seemingly the same but behave different way.
At Thu, 16 May 2019 15:29:36 -0400, Robert Haas <robertmh...@gmail.com> wrote in <ca+tgmobk1ngid9pxs7g8rfqdh+o1x4yyl+vmqtav7i6m-xn...@mail.gmail.com> > On Thu, May 16, 2019 at 2:56 PM Fujii Masao <masao.fu...@gmail.com> wrote: > > Yes. Thanks for the comment! > > Attached is the updated version of the patch. > > It adds such common rule. > > I'm not sure how much value it really has to define > opt_boolean_or_string_or_numeric. It saves 1 line of code in each of > 3 places, but costs 6 lines of code to have it. ANALYZE (options) desn't accept 1/0 but only accepts true/false or on/off. Why are we going to make VACUUM differently? And the documentation for ANALYZE doesn't mention the change. I think we don't need to support 1/0 as boolean here (it's unnatural) and the documentation of VACUUM/ANALYZE should be fixed. > Perhaps we could try to unify at a higher level. Like can we merge > vac_analyze_option_list with explain_option_list? Also REINDEX (VERBOSE) doesn't accept explict argument as of now. (reindex_option_list) I'm not sure about FDW/SERVER/CREATE USER MAPPING but perhaps it's a different from this. COPY .. WITH (options) doesn't accpet 1/0 as boolean. copy_generic_opt_arg: opt_boolean_or_string { $$ = (Node *) makeString($1); } | NumericOnly { $$ = (Node *) $1; } | '*' { $$ = (Node *) makeNode(A_Star); } | '(' copy_generic_opt_arg_list ')' { $$ = (Node *) $2; } | /* EMPTY */ { $$ = NULL; } ; regards. -- Kyotaro Horiguchi NTT Open Source Software Center