Skip to content

Instantly share code, notes, and snippets.

@iakio
Created January 20, 2010 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iakio/281672 to your computer and use it in GitHub Desktop.
Save iakio/281672 to your computer and use it in GitHub Desktop.
ishida=# create function any_eq (anyelement, anyelement) returns boolean language sql as 'select $1 = $2';
CREATE FUNCTION
ishida=# create operator == (procedure = any_eq, leftarg=anyelement, rightarg=anyelement);
CREATE OPERATOR
ishida=# select 1+2 == 3;
?column?
----------
t
(1 row)
ishida=# select 'abc' == 'abc';
ERROR: could not determine polymorphic type because input has type "unknown"
ishida=# select 'abc' == 'abc'::text;
?column?
----------
t
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment