Re: problem with select where like ']' - Mailing list pgsql-sql

From Tom Lane
Subject Re: problem with select where like ']'
Date
Msg-id 1986.971811218@sss.pgh.pa.us
Whole thread Raw
In response to problem with select where like ']'  (hubert depesz lubaczewski <depesz@depesz.pl>)
List pgsql-sql
hubert depesz lubaczewski <depesz@depesz.pl> writes:
> but i'm just wondering why like ']' doesn't work.

What LOCALE setting are you running the postmaster in?

']' is not a special character as far as LIKE is concerned, but
I suspect you may be seeing another variant of the problems that
LIKE index optimization has with peculiar collation rules.
You can find plenty of discussion of this in the mailing list archives
:-(

If there is an index on the field you are doing LIKE on, try dropping
the index to see if that makes the problem go away.

Another possibility is that you have been careless about always starting
the postmaster with the same LOCALE setting, in which case the index
may actually be corrupt (out of order) due to different records having
been inserted with different ideas about what the sort ordering should be.
In that case, dropping and recreating the index should help.
        regards, tom lane


pgsql-sql by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: problem with select where like ']'
Next
From: KuroiNeko
Date:
Subject: Re: problem with select where like ']'