Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4F559643CD6 for ; Mon, 15 Mar 2010 14:05:24 -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 78482-01-3 for ; Mon, 15 Mar 2010 17:05:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tomts5-srv.bellnexxia.net (tomts5-srv.bellnexxia.net [209.226.175.25]) by mail.postgresql.org (Postfix) with ESMTP id C0167643B88 for ; Mon, 15 Mar 2010 14:02:00 -0300 (ADT) Received: from toip4.srvr.bell.ca ([209.226.175.87]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20100315170149.FCIQ2554.tomts5-srv.bellnexxia.net@toip4.srvr.bell.ca> for ; Mon, 15 Mar 2010 13:01:49 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAL//nUvPI+0k/2dsb2JhbACaE4FQuWmEewQ Received: from pop.cryptocard.com (HELO smtp.cryptocard.com) ([207.35.237.36]) by toip4.srvr.bell.ca with ESMTP; 15 Mar 2010 13:24:45 -0400 Received: from pop.cryptocard.com (localhost [127.0.0.1]) by smtp.cryptocard.com (Spam & Virus Firewall) with ESMTP id EC10229A5EE for ; Mon, 15 Mar 2010 13:01:47 -0400 (EDT) Received: from pop.cryptocard.com (exchange03.cryptocard.internal [192.168.10.27]) by smtp.cryptocard.com with ESMTP id MzIoYENdafktInkY for ; Mon, 15 Mar 2010 13:01:47 -0400 (EDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Subject: Re: Odd query behavior Date: Mon, 15 Mar 2010 13:01:53 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] Odd query behavior thread-index: AcrEULsVEXq1DcAURuqlsNHKRI3vHAADU17w References: <622.1268411385@sss.pgh.pa.us> <18118.1268665439@sss.pgh.pa.us> From: "Dan McFadyen" To: "Tom Lane" Cc: 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/76 X-Sequence-Number: 33783 Bah... yes Windows. For being a developer I certainly miss all the details that make a good bug report/question. Also, sorry about the CC, don't post to lists often and I forget. Now, the interesting part is for all I can tell, there are no special characters in the field. Unless the latest version of Pgadmin (1.10.1 or 1.10.2) hides this from the UI, either that or it's some character that renders into a similar glyph as ASCII. Is there any way to force hex/binary in a SQL statement?=20 -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: Monday, March 15, 2010 11:04 AM To: Dan McFadyen Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Odd query behavior=20 "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. The information transmitted is intended only for the person or entity to wh= ich it is addressed and may contain confidential and/or privileged material= . Statements and opinions expressed in this e-mail may not represent those = of the company. Any review, retransmission, dissemination or other use of, = or taking of any action in reliance upon, this information by persons or en= tities other than the intended recipient is prohibited. If you received thi= s in error, please contact the sender immediately and delete the material f= rom any computer. Please see our legal details at http://www.cryptocard.co= m=0D CRYPTOCard Inc. is registered in the province of Ontario, Canada with Busin= ess number 80531 6478. CRYPTOCard Europe is limited liability company regi= stered in England and Wales (with registered number 05728808 and VAT number= 869 3979 41); its registered office is Aztec Centre, Aztec West, Almondsbu= ry, Bristol, UK, BS32 4TD=0D =0D