How to get the function name of an PostgreSQL operator

SQL query

SELECT oprname,
       oprcode,
       tleft.typname   AS oprleft,
       tright.typname  AS oprright,
       tresult.typname AS oprresult
FROM pg_operator o
         INNER JOIN pg_type tleft ON o.oprleft = tleft.oid
         INNER JOIN pg_type tright ON o.oprright = tright.oid
         INNER JOIN pg_type tresult ON o.oprresult = tresult.oid
ORDER BY oprname, oprleft, oprright, oprresult;
You may also choose to filter by the operator (oprname), for example:
WHERE oprname ='~'
to see all function names (oprcode) that implements the ~ operator.

External links