merge pg_proc and pg_operator?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: merge pg_proc and pg_operator?
Date: 2011-07-02 21:02:05
Message-ID: 1309640525.26660.22.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-07-02 21:20:07 Re: merge pg_proc and pg_operator?
Previous Message Tom Lane 2011-07-02 20:47:52 Re: plpython thinks it's hooked into "make distprep", but not so much