Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3D83A633F74 for ; Fri, 12 Mar 2010 12:04:50 -0400 (AST) 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 78828-07 for ; Fri, 12 Mar 2010 16:04:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mail.postgresql.org (Postfix) with ESMTP id 981E9633236 for ; Fri, 12 Mar 2010 12:04:39 -0400 (AST) Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Nq7Lq-0005eM-7W; Fri, 12 Mar 2010 09:04:38 -0700 Received: from [208.187.158.94] (helo=[172.16.1.233]) by in02.mta.xmission.com with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Nq7Lq-0006am-17; Fri, 12 Mar 2010 09:04:38 -0700 Message-ID: <4B9A6689.2030904@gmail.com> Date: Fri, 12 Mar 2010 09:06:33 -0700 From: Rob Sargent User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100228 SUSE/3.0.3-1.1.1 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Odd query behavior References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in02.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: pgsql-sql@postgresql.org, rsargent@amirsys.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-SA-Exim-Scanned: No (on in02.mta.xmission.com); SAEximRunCond expanded to false 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/67 X-Sequence-Number: 33774 Any views involved, or separate users/roles? On 03/12/2010 08:41 AM, Dan McFadyen wrote: > Hello, > > > > I've come across an odd situation. I've had access to a database where a > the following happens: > > > > " SELECT * FROM table WHERE name LIKE 'abc%' " returns 2 rows... > > > > but... > > > > " SELECT * FROM table WHERE name IN (SELECT name FROM table WHERE name > LIKE 'abc%') " returns 0 rows... > > > > I've also tried doing a join on the column to another table that has > what appears to be the same data, and the join comes out with zero rows. > Weirder yet, I took the hash of both of the values and it came out > identical. > > > > Now, I know the first thing you'll ask is if you can get a copy of the > data to re-produce it, and the problem is, I got a copy of the data in > question, and loaded into another server and it works fine. Both queries > return 2 rows. > > > > I do know that server it was running on was Finnish. The database uses a > UTF8 encoding though, so I don't know what that would make any difference. > > > > Any ideas about things I should be looking at? > > > > Thanks > > > > Dan > > > > The information transmitted is intended only for the person or entity to > which 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 entities other than the intended > recipient is prohibited. If you received this in error, please contact > the sender immediately and delete the material from any computer. Please > see our legal details at http://www.cryptocard.com CRYPTOCard Inc. is > registered in the province of Ontario, Canada with Business number 80531 > 6478. CRYPTOCard Europe is limited liability company registered in > England and Wales (with registered number 05728808 and VAT number 869 > 3979 41); its registered office is Aztec Centre, Aztec West, > Almondsbury, Bristol, UK, BS32 4TD