Re: Proposal : REINDEX xxx VERBOSE - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Proposal : REINDEX xxx VERBOSE
Date
Msg-id CA+TgmoYagUHzwTqTdpqKajQmOUY_9Ld6Wc6VqpC-+=-WdvS-5g@mail.gmail.com
Whole thread Raw
In response to Re: Proposal : REINDEX xxx VERBOSE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal : REINDEX xxx VERBOSE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Feb 4, 2015 at 8:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> writes:
>> The phrase "{INDEX | TABLE |..} name" seems to me indivisible as
>> target specification. IMHO, the options for VACUUM and so is
>> placed *just after* command name, not *before* the target.
>
>> If this is right, the syntax would be like this.
>
>> REINDEX [ (option [, option ...] ) ] {INDEX | TABLE | etc } name
>
>> What do you think about this?
>
> I think this is wrong and ugly.  INDEX etc are part of the command name.

I don't think so.  I think they're part of the target.  We have one
manual page is for REINDEX, not five separate reference pages for
REINDEX INDEX, REINDEX TABLE, REINDEX SCHEMA, REINDEX DATABASE, and
REINDEX SYSTEM.  If we really wanted to, we could probably even
support this:

REINDEX INDEX foo, TABLE bar, TABLE baz;

We've got a mix of styles for extensible options right now:

EXPLAIN [ ( option [, ...] ) ] statement
COPY table_name [ ( column_name [, ...] ) ]   FROM { 'filename' | PROGRAM 'command' | STDIN }   [ [ WITH ] ( option [,
...]) ]
 
VACUUM [ ( { FULL | FREEZE | VERBOSE | ANALYZE } [, ...] ) ] [
table_name [ (column_name [, ...] ) ] ]

So COPY puts the options at the very end, but EXPLAIN and VACUUM put
them right after the command name.  I prefer the latter style and
would vote to adopt it here.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: GRANT USAGE on FOREIGN SERVER exposes passwords
Next
From: Tom Lane
Date:
Subject: Re: Proposal : REINDEX xxx VERBOSE