Re: [HACKERS] create operator problem - Mailing list pgsql-hackers

From Tom Ivar Helbekkmo
Subject Re: [HACKERS] create operator problem
Date
Msg-id 86ra2nql70.fsf@barsoom.Hamartun.Priv.NO
Whole thread Raw
In response to create operator problem  ("Vazsonyi Peter[ke]" <neko@kornel.szif.hu>)
List pgsql-hackers
"Vazsonyi Peter[ke]" <neko@kornel.szif.hu> writes:

> drop operator ~~ (text,text);
> DROP
> create operator ~~ (leftarg=text,rightarg=text,procedure=mylike);
> CREATE
> select 'this will be true'::text ~~ 'true';
> ?column?
> --------
> f
> (1 row)
> -- it seems not ;(

I got bitten by this, too.  There's special handling of ~~ hardcoded
into the parser, which expects that it implements the vanilla flavor
of likeness testing.  It has to do with enabling the use of indices to
speed up the matching.  Bottom line: you can't redefine it.

-tih
--
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"

pgsql-hackers by date:

Previous
From: Byron Nikolaidis
Date:
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size