X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0332B9DCB5F for ; Thu, 8 Dec 2005 04:21:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77913-06 for ; Thu, 8 Dec 2005 04:21:53 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 48B919DCB64 for ; Thu, 8 Dec 2005 04:21:49 -0400 (AST) Received: (qmail invoked by alias); 08 Dec 2005 08:21:50 -0000 Received: from dslb-084-063-026-116.pools.arcor-ip.net (EHLO colt.pezone.net) [84.63.26.116] by mail.gmx.net (mp015) with SMTP; 08 Dec 2005 09:21:50 +0100 X-Authenticated: #495269 From: Peter Eisentraut To: pgsql-sql@postgresql.org Subject: Re: Locale and pattern matching Date: Thu, 8 Dec 2005 09:21:49 +0100 User-Agent: KMail/1.8.2 Cc: =?iso-8859-1?q?H=E9lder_M=2E_Vieira?= References: <001801c5fb98$025ac0f0$580bfea9@hmv02> In-Reply-To: <001801c5fb98$025ac0f0$580bfea9@hmv02> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200512080921.49722.peter_e@gmx.net> X-Y-GMX-Trusted: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.082 required=5 tests=[AWL=-0.154, RCVD_IN_SORBS_WEB=1.236] X-Spam-Score: 1.082 X-Spam-Level: * X-Archive-Number: 200512/71 X-Sequence-Number: 23613 Hélder M. Vieira wrote: > For instance, if the pattern specifies an uppercase 'A' with an > accute accent, then it will match a lowercase 'A' with an accute > accent, but not an upper or lower case 'A' with a tilde. > This behaviour seems inconsistent with that of the ORDER BY clause, > which considers all forms of a vowel as equal This is not exactly true. Sorting just goes through the strings in multiple passes, looking at the "general" letter first, then at the case, then at the accents, until it finds a difference. > Shouldn't case insensitive pattern matching follow the same collation > weights that ORDER BY uses ? Even if it did, it would not help you, as explained above. Moreover, the collation rules of some locales are sufficiently weird that a consistent behavior between sorting and pattern matching is impossible to achieve. > Until now, I've been selecting LATIN1 encoding, but after a few > tests, I came to think that LATIN9 is a better option (the euro > sign...). For those who regularly use LATIN9, what is your opinion ? > Is it indeed a better option ? Yes. -- Peter Eisentraut http://developer.postgresql.org/~petere/