Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A0AA663441B for ; Thu, 11 Mar 2010 12:50:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 22594-07 for ; Thu, 11 Mar 2010 16:50:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 086D9633D6D for ; Thu, 11 Mar 2010 12:50:47 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o2BGoi9x021729; Thu, 11 Mar 2010 11:50:44 -0500 (EST) To: desoft@freemail.gr cc: pgsql-admin@postgresql.org Subject: Re: select (\' \' ~* \' \')=true while select (\' \' ilike \' \') In-reply-to: <4b86bdeb03d3c8.17572985@freemail.gr> References: <4b86bdeb03d3c8.17572985@freemail.gr> Comments: In-reply-to desoft@freemail.gr message dated "Thu, 25 Feb 2010 20:14:03 +0200" Date: Thu, 11 Mar 2010 11:50:44 -0500 Message-ID: <21728.1268326244@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/78 X-Sequence-Number: 33877 desoft@freemail.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