Re: VACUUM fails to parse 0 and 1 as boolean value

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: robertmhaas(at)gmail(dot)com
Cc: masao(dot)fujii(at)gmail(dot)com, andres(at)anarazel(dot)de, sawada(dot)mshk(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: VACUUM fails to parse 0 and 1 as boolean value
Date: 2019-05-17 01:24:25
Message-ID: 20190517.102425.08301266.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mmm. It has gone before complete.

At Fri, 17 May 2019 10:21:21 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20190517(dot)102121(dot)72558057(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)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(at)gmail(dot)com> wrote in <CA+TgmobK1ngid9Pxs7g8RFQDH+O1X4yyL+vMQtaV7i6m-Xn0rw(at)mail(dot)gmail(dot)com>
> > On Thu, May 16, 2019 at 2:56 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2019-05-17 01:27:40 Re: PostgreSQL 12: Feature Highlights
Previous Message Kyotaro HORIGUCHI 2019-05-17 01:21:21 Re: VACUUM fails to parse 0 and 1 as boolean value