Re: Proposal : REINDEX xxx VERBOSE

From: Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal : REINDEX xxx VERBOSE
Date: 2015-02-24 14:28:43
Message-ID: CAD21AoD7mosxpX1pBGx-KGUJn-Jc+AocWxEc5LBhMqi0x2e7Ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 20, 2015 at 12:24 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hello,
>
> I showed an extreme number of examples to include *almost of all*
> variations of existing syntax of option specification. And showed
> what if all variations could be used for all commands. It was
> almost a mess. Sorry for the confusion.
>
> I think the issues at our hands are,
>
> - Options location: at-the-end or right-after-the-keyword?
>
> - FORCE options to be removed?
>
> - Decide whether to allow bare word option if the options are to
> be located right after the keyword.
>
> Optinions or thoughts?
>
> ====
> Rethinking from here.
>
> At Wed, 11 Feb 2015 14:34:17 -0600, Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> wrote in <54DBBCC9(dot)1020206(at)BlueTreble(dot)com>
>> On 2/5/15 12:01 PM, Tom Lane wrote:
> ...
>> > Meh. Options-at-the-end seems by far the most sensible style to me.
>> > The options-right-after-the-keyword style is a mess, both logically
>> > and from a parsing standpoint, and the only reason we have it at all
>> > is historical artifact (ask Bruce about the origins of VACUUM ANALYZE
>> > over a beer sometime).
> ...
>> I know you were worried about accepting options anywhere because it
>> leads to reserved words, but perhaps we could support it just for
>> EXPLAIN and VACUUM, and then switch to trailing options if people
>> think that would be better.
>
> According to the above discussion, VACUUM and REINDEX should have
> trailing options. Tom seems (to me) suggesting that SQL-style
> (bare word preceded by WITH) options and Jim suggesting '()'
> style options? (Anyway VACUUM gets the *third additional* option
> sytle, but it is the different discussion from this)
>
> VACUUM [tname [(cname, ...)]] [({FULL [bool]|FREEZE | [bool]|...})]
>
> =# VACUUM t1 (FULL, FREEZE);
>
> VACUUM [tname [(cname, ...)]] [WITH [FULL [bool]]|[FREEZE | [bool]|...]
>
> =# VACUUM t1 WITH FULL;
>
> IMHO, we are so accustomed to call by the names "VACUUM FULL" or
> "VACUUM FREEZE" that the both of them look a bit uneasy.
>
>
> If the new syntax above is added, REINDEX should have *only* the
> trailing style.
>
> REINDEX [{INDEX|TABLE|...}] name [(VERBOSE [bool]|...)]
>
> =# REINDEX TABLE t1 (VERBOSE);
>
> REINDEX [{INDEX|TABLE|...}] name [WITH {VERBOSE [bool]|...}]
>
> =# REINDEX INDEX i_t1_pkey WITH VERBOSE;
>
> Also, both of them seems to be unintuitive..
>
>
> EXPLAIN.. it seems to be preferred to be as it is..
>
>
> As the result, it seems the best way to go on the current syntax
> for all of those commands.
>
> Optinions?
>
>
>
> At Wed, 18 Feb 2015 23:58:15 +0900, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com> wrote in <CAD21AoBkjndQAq2Z-WbScMdHoX257BJj6sUYthwwFs2iL8YDhQ(at)mail(dot)gmail(dot)com>
>> From consistency perspective, I tend to agree with Robert to put
>> option at immediately after command name as follows.
>> REINDEX [(VERBOSE | FORCE)] {INDEX | ...} name;
>
> I don't object against it if you prefer it. The remaining issue
> is the choice between options-at-the-end or this
> options-right-after-the-keyword mentioned above. I prefer the
> more messy(:-) one..
>
>
>> Btw how long will the FORCE command available?
>
> The options is obsolete since 7.4. I think it should have been
> fade away long since and it's the time to remove it. But once the
> ancient option removed, the above syntax looks a bit uneasy and
> the more messy syntax looks natural.
>
>
> REINDEX [VERBOSE] {INDEX | ...} name;
>
> That do you think about this?
>

Thank you for summarizing them.

I said right-after-the-keyword is looks good to me.
But it's will be possible only if FORCE command is removed.
REINDEX command has FORCE option at the end, so REINDEX probably
should have options at the end.

Regards,

-------
Sawada Masahiko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-02-24 14:36:54 Re: [REVIEW] Re: Compression of full-page-writes
Previous Message Andres Freund 2015-02-24 14:24:58 Re: deparsing utility commands