Re: select (\' \' ~* \' \')=true while select (\' \' ilike \' \')

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: desoft(at)freemail(dot)gr
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: select (\' \' ~* \' \')=true while select (\' \' ilike \' \')
Date: 2010-03-11 16:50:44
Message-ID: 21728.1268326244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

desoft(at)freemail(dot)gr writes:
> encoding is set correctly.

To what?

> While ilike works correctly ~* doesn't why ?

~* is known to have issues in multibyte encodings (eg UTF8).
Fixing this is on the TODO list, but nobody's thought of a
reasonably clean fix yet.

There is a partial solution in place for 9.0 --- it should work for
UTF8, though not for other multibyte encodings. If you're feeling
desperate you could try backpatching this commit:
http://archives.postgresql.org/message-id/20091201210024.B1393753FB7@cvs.postgresql.org
However the path of least resistance might be to use a single-byte
encoding in your database, such as LATIN1.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nicos Panayides 2010-03-12 16:40:43 Off-site storage for PITR logs
Previous Message Kevin Grittner 2010-03-11 16:38:05 Re: select (\'*\' ~* \'*\')=true while select (\'*\' ilike \'*\')