merge pg_proc and pg_operator? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject merge pg_proc and pg_operator?
Date
Msg-id 1309640525.26660.22.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: merge pg_proc and pg_operator?
List pgsql-hackers
This thought reemerged in me during the recent discussion of the regular
expression matching operators: A lot of things could be better if
pg_proc and pg_operator were merged together.

Most importantly, operator optimization information could be attached to
procedures, so developers and users wouldn't have to make up ever more
confusing operator names, and application code would be cleaner, e.g.,
   SELECT * FROM sometable WHERE somehow_intersects(a, b)

vs.
   SELECT * FROM sometable WHERE a ~~@<>@~~ b;

Internally, you could delete a lot of duplicate code.  In the abstract,
an operator is after all just a function call with a different syntax.
But you could just as well call
   "+"(a, b)

or
   a OPERATOR("add") b

Once things are out of the parser, it's all the same.

What do you think?




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpython thinks it's hooked into "make distprep", but not so much
Next
From: Tom Lane
Date:
Subject: Re: merge pg_proc and pg_operator?