Currently, there is not an easy way to get PG's binary operators' functions for a specific pair of types.
All Python operators can return arbitrary objects. We can take advantage of this by giving Postgres.Type instances operator methods that return the function associated with the corresponding PG operator:
Currently, there is not an easy way to get PG's binary operators' functions for a specific pair of types.
All Python operators can return arbitrary objects. We can take advantage of this by giving Postgres.Type instances operator methods that return the function associated with the corresponding PG operator:
from Postgres.types import int2, int4, int8
map(int2 < int4, [(123,5432100), ...])