X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DCEF052AF3 for ; Sun, 24 Jul 2005 15:42:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35456-08 for ; Sun, 24 Jul 2005 18:41:55 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id AA57B52AF4 for ; Sun, 24 Jul 2005 15:41:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j6OIfi1h021994; Sun, 24 Jul 2005 14:41:44 -0400 (EDT) To: Jamie Lawrence Cc: pgsql-sql@postgresql.org Subject: Re: Different encodings in different DBs in same cluster In-reply-to: <20050721183224.GA19811@clueinc.net> References: <20050721183224.GA19811@clueinc.net> Comments: In-reply-to Jamie Lawrence message dated "Thu, 21 Jul 2005 14:32:24 -0400" Date: Sun, 24 Jul 2005 14:41:44 -0400 Message-ID: <21993.1122230504@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/216 X-Sequence-Number: 22194 Jamie Lawrence writes: > I see: > Since these locale settings are frozen by initdb, the apparent > flexibility to use different encodings in different databases of a > cluster is more theoretical than real. > Does anyone know what "more theoretical than real" mean in this context? It means there are some locales that actively fail (you get inconsistent comparison and sorting behavior) when presented with multibyte data that doesn't match their encoding expectations. IMHO such locale definitions are broken and should be fixed, but they are not under our control. > If I set the locale to C, is it going to work correctly with UTF8 > encoded data? C will work "correctly" for suitably small values of "correctly" --- non-ASCII characters may not sort where you'd wish, and it won't know anything about case-folding for non-ASCII characters. But it will at least give consistent results. When you use a non-C locale, it's best to stick to the encoding that the locale expects. regards, tom lane