Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5FUR-0004e5-2N for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2016 16:47:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5FUQ-0005Td-LO for pgsql-hackers@arkaria.postgresql.org; Tue, 24 May 2016 16:47:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5FUP-0005SA-MQ for pgsql-hackers@postgresql.org; Tue, 24 May 2016 16:47:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5FUL-0005hO-9s for pgsql-hackers@postgresql.org; Tue, 24 May 2016 16:47:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u4OGlKk3002197; Tue, 24 May 2016 12:47:21 -0400 From: Tom Lane To: Nikolay Shaplov cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet In-reply-to: <1593237.l7oKHRpxSe@nataraj-amd64> References: <1593237.l7oKHRpxSe@nataraj-amd64> Comments: In-reply-to Nikolay Shaplov message dated "Mon, 16 May 2016 16:21:10 +0300" Date: Tue, 24 May 2016 12:47:20 -0400 Message-ID: <2196.1464108440@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Nikolay Shaplov 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