Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5FB8A64038C for ; Mon, 15 Mar 2010 12:04:12 -0300 (ADT) 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 54061-09 for ; Mon, 15 Mar 2010 15:04:02 +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 D456563FE5D for ; Mon, 15 Mar 2010 12:04:01 -0300 (ADT) 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 o2FF3xqV018119; Mon, 15 Mar 2010 11:03:59 -0400 (EDT) To: "Dan McFadyen" cc: pgsql-sql@postgresql.org Subject: Re: Odd query behavior In-reply-to: References: <622.1268411385@sss.pgh.pa.us> Comments: In-reply-to "Dan McFadyen" message dated "Mon, 15 Mar 2010 09:18:22 -0400" Date: Mon, 15 Mar 2010 11:03:59 -0400 Message-ID: <18118.1268665439@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/75 X-Sequence-Number: 33782 "Dan McFadyen" writes: > You're right, the second one does use an index, one that is used to > enforce a unique constraint on the column. I wasn't able to turn it off > as the database is currently in use, and disabling a unique constraint > probably isn't a good idea. > Sorry for not mentioning the PG version, it's 8.3. > Now, as for the LC_CTYPE, I didn't even know about such a thing till you > mentioned it, and I found the lovely disclaimers in the postgresql docs > about the consequences of it not being c or posix. > It's Finnish Finland 1252. If that's the probable cause, I'm guessing > the only option is to export, re-initdb, and import. Oh, this is Windows huh? In principle, UTF8 encoding should work in all locales for Windows --- at least, the code thinks so, which is why it let you create that combination to start with. I'm not very familiar with the possible pitfalls though. If you don't actually have any use for Finnish-specific sorting or case-folding, a re-initdb in C locale would probably be a good idea. In the meantime it seems there might be a bug here. Can you give more information about the contents of the column involved, in particular what non-7-bit-ASCII characters it contains? regards, tom lane PS: please cc the list on replies.