From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nikita Glukhov <n.gluhov@postgrespro.ru>
Cc: Nikolay Shaplov <dhyan@nataraj.su>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Oleg Bartunov <obartunov@gmail.com>
Subject: Re: [PATCH] Opclass parameters
Date: Thu, 06 Dec 2018 11:55:39 -0500
Message-ID: <21380.1544115339@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoaSBpUMZBnX6FeDct0a3aeuM-gTXB7Q-Pqob3tPowXF8A@mail.gmail.com>
References: <d22c3a18-31c7-1879-fc11-4c1ce2f5e5af@postgrespro.ru>
<6382cb29-83d8-90f2-1dbb-b4ac606cbf1f@postgrespro.ru>
<71c6164e-59ad-e0c4-76c5-b1dfdd68eee3@postgrespro.ru>
<12473406.MrkCg5crFA@x200m>
<6105d858-a060-dec7-48a1-016ac24884cf@postgrespro.ru>
<CA+TgmoaSBpUMZBnX6FeDct0a3aeuM-gTXB7Q-Pqob3tPowXF8A@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Dec 5, 2018 at 6:58 PM Nikita Glukhov <n.gluhov@postgrespro.ru> wrote:
>> "opclass (options)" looks the most natural to me. But we still need some
>> keyword before the parentheses when the opclass is not specified since we
>> can't distinguish "func_name (func_params)" and "col_name (opclass_options)"
>> 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
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, n.gluhov@postgrespro.ru, dhyan@nataraj.su, pgsql-hackers@lists.postgresql.org, obartunov@gmail.com
Subject: Re: [PATCH] Opclass parameters
In-Reply-To: <21380.1544115339@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