Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUwwE-00084Y-MW for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Dec 2018 16:55:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUwwD-0008Qd-2H for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Dec 2018 16:55:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUwwC-0008Q5-NX for pgsql-hackers@lists.postgresql.org; Thu, 06 Dec 2018 16:55:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUww9-0007WE-NL for pgsql-hackers@lists.postgresql.org; Thu, 06 Dec 2018 16:55:43 +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 wB6GtdTg021381; Thu, 6 Dec 2018 11:55:39 -0500 From: Tom Lane To: Robert Haas cc: Nikita Glukhov , Nikolay Shaplov , PostgreSQL Hackers , "pgsql-hackers@postgresql.org" , Oleg Bartunov Subject: Re: [PATCH] Opclass parameters In-reply-to: References: <6382cb29-83d8-90f2-1dbb-b4ac606cbf1f@postgrespro.ru> <71c6164e-59ad-e0c4-76c5-b1dfdd68eee3@postgrespro.ru> <12473406.MrkCg5crFA@x200m> <6105d858-a060-dec7-48a1-016ac24884cf@postgrespro.ru> Comments: In-reply-to Robert Haas message dated "Thu, 06 Dec 2018 11:47:53 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21379.1544115339.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 06 Dec 2018 11:55:39 -0500 Message-ID: <21380.1544115339@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Wed, Dec 5, 2018 at 6:58 PM Nikita Glukhov = wrote: >> "opclass (options)" looks the most natural to me. But we still need som= e >> keyword before the parentheses when the opclass is not specified since = we >> can't distinguish "func_name (func_params)" and "col_name (opclass_opti= ons)" >> in grammar. > Are you sure? What's the SQL syntax where there is actually a problem > here? CREATE INDEX requires parentheses around a non-trivial > expression. Well, the reason we have to require parens around nontrivial expressions is mostly lack of forethought about making the syntax non-ambiguous :-( > How about just OPTIONS (options) ? That would require making OPTIONS a fully reserved word, I think, else it's ambiguous with an opclass name. How about saying that you must give an opclass name if you want to specify options, ie the syntax is [ opclass_name [ ( options... ) ] ] I'm not necessarily wedded to that, but it seems worth throwing out the idea. regards, tom lane