Default Operator Class for datatype - Mailing list pgsql-general

From Jakub Królikowski
Subject Default Operator Class for datatype
Date
Msg-id BANLkTi=YhZ7E2h1FGtvJt8OQWUD0-6YDvQ@mail.gmail.com
Whole thread Raw
Responses Default Operator Class for datatype  (Jakub Królikowski <jakub@pakamera.com.pl>)
List pgsql-general
Hello,

I've set pl_PL.UTF-8 collation on my database after upgrade do 9.0.
That means indexes for varchar column doesn't work anymore in selects
using "like" or "=" operators with that columns.
I know the solution - operator classes - which works very well.
But that means I have to find and recreate all indexes on varchar
column like this:
CREATE INDEX test_index ON test_table (col varchar_pattern_ops);

Does anybody know if there is any possibility to set a default
operator class for varchar datatatype?
I can see that in system table pg_catalog.pg_opclass ther is a column
called "opcdefault". Does anybody has an experience with changing that
value? The idea is to set this default operator class and make after
that dump-restore of database data. Should work.

Best regards,

Jakub

pgsql-general by date:

Previous
From: Michael Graham
Date:
Subject: Rearranging simple where clauses
Next
From: "Dickson S. Guedes"
Date:
Subject: Re: postgresql not updating the sequence