pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikolay Shaplov <n.shaplov@postgrespro.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet
Date: Tue, 24 May 2016 12:47:20 -0400
Message-ID: <2196.1464108440@sss.pgh.pa.us> (raw)
In-Reply-To: <1593237.l7oKHRpxSe@nataraj-amd64>
References: <1593237.l7oKHRpxSe@nataraj-amd64>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Nikolay Shaplov <n.shaplov@postgrespro.ru> writes:
> If I read gram.y code for insert statement, I see that there is an optional 
> USING keyword before opclass name

> opt_class:  any_name                                { $$ = $1; }
>             | USING any_name                        { $$ = $2; }
>             | /*EMPTY*/                             { $$ = NIL; }
>         ;

> but it the documentation this keyword is omitted.

I think we should seriously consider fixing this code/docs discrepancy
by making the code match the docs, not vice versa.  That is, let's just
remove the USING alternative here entirely.

If we wanted to make the docs match the code, it would not only be
CREATE INDEX that would have to be patched, because that's not the
only place that index_elem can appear.  As far as I can find in a
quick search, none of the relevant statements have ever documented
that USING is allowed here; nor does it appear that any client-side
code of ours makes use of the keyword.

Also, because USING is already used elsewhere in CREATE INDEX (to
introduce the optional index AM name), I think that documenting its
use in this clause would add confusion not subtract it.  References
to "the USING clause in CREATE INDEX" would become ambiguous.

This wouldn't be something to back-patch, of course, but I think it's
an entirely reasonable change to make in HEAD.

Comments?

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (12+ messages)  latest in thread

Message-ID: <2196.1464108440@sss.pgh.pa.us>
Permalink:  ../2196.1464108440@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2196.1464108440@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, n.shaplov@postgrespro.ru
  Subject: Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet
  In-Reply-To: <2196.1464108440@sss.pgh.pa.us>
  References: <1593237.l7oKHRpxSe@nataraj-amd64> <2196.1464108440@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox