Peter Eisentraut <peter_e@gmx.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