Strange issue with CREATE OPERATOR CLASS

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Strange issue with CREATE OPERATOR CLASS
Date: 2009-02-11 23:03:00
Message-ID: 49935924.9050509@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2009-02-11 23:12:35 Re: A deprecation policy
Previous Message Tom Lane 2009-02-11 22:39:16 Re: So, what locale should the regression tests run in?