Re: Patch to add CREATE OPERATOR CLASS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Bill Studenmund <wrstuden(at)netbsd(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch to add CREATE OPERATOR CLASS
Date: 2002-02-27 07:08:15
Message-ID: 20562.1014793695@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> I'm having a few issues with the syntax. Basically, what you have is
> CREATE OPERATOR CLASS name FOR TYPE type AS ... USING ... WITH ... AND ...

> How about choosing these key words so that they actually declare what the
> ... stands for. It would also nice if these could be allowed in a more
> flexible order.

Good point. I'm not that excited about varying the order of clauses,
but certainly "AND" is not a helpful indication of which clause means
what.

The data type and access method are required identification info, so
I don't see a lot of value in a syntax that makes them look optional,
much less one that allows them to occur multiple times. How about

CREATE OPERATOR CLASS name [ DEFAULT ] FOR TYPE type USING accessmethod
{ FUNCTION num name(parms)
| OPERATOR num name [ ( type, type ) ] [ RECHECK ]
| STORAGE typename
} [, ...]

We could argue whether DEFAULT should be one of the flexibly-ordered
clauses rather than having the special position shown here. This way
seems more naturally readable to me, but I'm not dead set on it.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Janardhana Reddy 2002-02-27 08:22:42 Re: WAL Performance Improvements
Previous Message Hannu Krosing 2002-02-27 04:16:06 Re: [HACKERS] WAL Performance Improvements