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.na...@bluetreble.com> wrote in <54dbbcc9.1020...@bluetreble.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.m...@gmail.com> wrote in <cad21aobkjndqaq2z-wbscmdhox257bjj6suythwwfs2il8y...@mail.gmail.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? regards, At Tue, 17 Feb 2015 12:00:13 -0600, Jim Nasby <jim.na...@bluetreble.com> wrote in <54e381ad.1090...@bluetreble.com> > > VACUUM [FULL] [FREEZE] ... [ANALYZE] [tname [(cname, ...)] > > | VACUUM [({FULL [bool]|FREEZE [bool]|...}[,...])] [tname [(cname, ...)] > > | VACUUM [tname [(cname, ...)] [[WITH ]({FULL [bool]|FREEZE > > | [bool]|...})] > > > > REINDEX [{INDEX|TABLE|...}] name [[WITH] (VERBOSE [bool]|...)] > > > > EXPLAIN [[WITH] ({ANALYZE [bool]|VERBOSE [bool]|... [,...]})] > > <statement> > > > > For concrete examples, the lines prefixed by asterisk are in new > > syntax. > > If I could choose only one for explain, I would find it easier to be > up front. That way you do the explain part on one line and just paste > the query after that. .. > > VACUUM FULL table1; > > VACUUM ANALYZE table1 (col1); > > VACUUM (ANALYZE, VERBOSE) table1 (col1); > > *VACUUM table1 WITH (FREEZE on) > > *VACUUM table1 (cola) WITH (ANALYZE) > > *VACUUM table1 WITH (ANALYZE) > > *VACUUM table1 (FREEZE on) > > > > The fifth example looks quite odd. > > I don't think we need to allow both () and WITH... I'd say one or the > other, preferably (). -- Kyotaro Horiguchi NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers