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 745C911F6709 for ; Wed, 5 Apr 2006 20:03:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08350-10 for ; Wed, 5 Apr 2006 20:03:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx3.surnet.cl (mx3.surnet.cl [216.155.73.182]) by postgresql.org (Postfix) with ESMTP id B32EA11F66FF for ; Wed, 5 Apr 2006 20:03:19 -0300 (ADT) Received: from unknown (HELO cluster.surnet.cl) ([216.155.73.165]) by mx3.surnet.cl with ESMTP; 05 Apr 2006 19:03:17 -0400 X-IronPort-AV: i="4.03,167,1141614000"; d="scan'208"; a="2540432:sNHT19947100" Received: from alvh.no-ip.org (201.220.123.5) by cluster.surnet.cl (7.0.043) (authenticated as alvherre@surnet.cl) id 43A978FD00D91FF2; Wed, 5 Apr 2006 19:03:17 -0400 Received: by alvh.no-ip.org (Postfix, from userid 1000) id CE474C2DC22; Wed, 5 Apr 2006 19:03:16 -0400 (CLT) Date: Wed, 5 Apr 2006 19:03:16 -0400 From: Alvaro Herrera To: Tomas Vondra Cc: pgsql-sql@postgresql.org Subject: Re: problem comparing strings when different cluster / database encoding Message-ID: <20060405230316.GE13673@surnet.cl> Mail-Followup-To: Tomas Vondra , pgsql-sql@postgresql.org References: <443444B5.1010205@fuzzy.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <443444B5.1010205@fuzzy.cz> User-Agent: Mutt/1.5.11+cvs20060330 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.678 required=5 tests=[AWL=-0.241, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.678 X-Spam-Level: * X-Archive-Number: 200604/30 X-Sequence-Number: 24839 Tomas Vondra wrote: Hi, > I've encountered a strange problem. We have a PG 8.0.x database cluster > (in the sense used in initdb, i.e. bunch of databases) created with > UNICODE encoding, namely cs_CZ.UTF-8 locale. > > When a database is created with a different encoding (in our case it's > LATIN2) the string comparison doesn't work correctly. Actually this is sort of expected. Your locale configuration expects a certain encoding; all databases should be created using that encoding for string comparison to work properly. What definitely is a bug is the fact that CREATE DATABASE allows you to create a database with an encoding different from the one defined by initdb. The conclusion is that you should create your databases using UTF-8 encoding if you are using cs_CZ.UTF-8, otherwise it won't work as expected. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support