Strange issue with CREATE OPERATOR CLASS - Mailing list pgsql-hackers

From Josh Berkus
Subject Strange issue with CREATE OPERATOR CLASS
Date
Msg-id 49935924.9050509@agliodbs.com
Whole thread Raw
Responses Re: Strange issue with CREATE OPERATOR CLASS
List pgsql-hackers
All,

I've been working on some scripts (for pgfoundry) which help in 
"cleaning up" databases which have TSearch and other contrib modules 
installed to schema public.  However, I ran into this odd issue:

ERROR:  btree operators must return boolean
STATEMENT:  CREATE OPERATOR CLASS contrib.tsquery_ops    DEFAULT FOR TYPE tsquery USING btree AS    OPERATOR 1
<(tsquery,tsquery),    OPERATOR 2 <=(tsquery,tsquery) ,    OPERATOR 3 =(tsquery,tsquery) ,    OPERATOR 4
>=(tsquery,tsquery),    OPERATOR 5 >(tsquery,tsquery) ,    FUNCTION 1 tsquery_cmp(tsquery,tsquery);
 

What appears to be happening there is that PG isn't finding the tsearch 
operators or is selecting the wrong operators.  Manually changing the 
search_path to "contrib, public" instead of "public, contrib" fixes the 
issue, but it seems odd that create opclass can't find operators unless 
they're in the "first" schema in the path, when other CREATE statements 
have no such difficulty.

--Josh


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: So, what locale should the regression tests run in?
Next
From: Josh Berkus
Date:
Subject: Re: A deprecation policy