Mmm. It has gone before complete.
At Fri, 17 May 2019 10:21:21 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in
<20190517.102121.72558057.horiguchi.kyotaro@lab.ntt.co.jp>
> We now have several syntax elements seemingly the same but behave
> different way.
>
> At Thu, 16 May 2019 15:29:36 -0400, Robert Haas <robertmhaas@gmail.com> wrote in
<CA+TgmobK1ngid9Pxs7g8RFQDH+O1X4yyL+vMQtaV7i6m-Xn0rw@mail.gmail.com>
> > On Thu, May 16, 2019 at 2:56 PM Fujii Masao <masao.fujii@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?
The patch changes the behvaior of ANALYZE together. Please ignore
this.
> 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