Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7FBD163383B for ; Fri, 24 Apr 2009 11:16:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 64629-01-4 for ; Fri, 24 Apr 2009 11:16:29 -0300 (ADT) X-Greylist: delayed 00:16:44.548678 by SQLgrey-1.7.6 Received: from mail2.washoecounty.us (mailfoundry.washoecounty.us [148.186.3.147]) by mail.postgresql.org (Postfix) with ESMTP id E9D1F6352ED for ; Fri, 24 Apr 2009 11:16:20 -0300 (ADT) Received: from wcmail.washoecounty.us (wcmail.washoecounty.us [148.186.120.215]) by mailpp2.washoecounty.us (8.14.3/8.14.3) with ESMTP id n3ODx5IY029444 for ; Fri, 24 Apr 2009 06:59:05 -0700 Received: from WCEMAILW.washoecounty.us ([148.186.120.219]) by wcmail.washoecounty.us with Microsoft SMTPSVC(6.0.3790.3959); Fri, 24 Apr 2009 06:59:31 -0700 Received: from 192.168.46.20 ([192.168.46.20]) by WCEMAILW.washoecounty.us ([148.186.120.130]) via Exchange Front-End Server owa.washoecounty.us ([148.186.120.215]) with Microsoft Exchange Server HTTP-DAV ; Fri, 24 Apr 2009 13:59:30 +0000 Received: from shop by owa.washoecounty.us; 24 Apr 2009 06:59:31 -0700 Subject: varchar value comparisons not working? From: Shawn Tayler Reply-To: stayler@washoecounty.us To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Washoe County Regional Communications System Date: Fri, 24 Apr 2009 06:59:30 -0700 Message-Id: <1240581570.21067.18.camel@shop.telecom.co.washoe.nv.us> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 X-OriginalArrivalTime: 24 Apr 2009 13:59:31.0833 (UTC) FILETIME=[E448BE90:01C9C4E4] X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.7400:2.4.4, 1.2.40, 4.0.166 definitions=2009-04-24_08:2009-04-23, 2009-04-24, 2009-04-24 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0811170000 definitions=main-0904240068 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/111 X-Sequence-Number: 32457 Hello, I'm doing a quick comparison between a couple tables, trying to cleanup some inconsistencies, and what should be a simple check between 2 tables doesn't seem to be working. psql is 8.3.7 and server is 8.2.13. I run the following: select sfd.lid as sflid,sd.lid as slid,sfd.serial from sfd,shawns_data sd where sfd.serial = sd.serial_number order by sfd.lid; the lid columns in both tables should be identical, but as you see in this sample, they do differ: sflid | slid | serial -------+-------+---------- 14056 | 14056 | 9614583 14057 | | 9614984 14058 | 14058 | 9614737 14059 | 14059 | 9614579 14060 | | 9614827 14061 | 14061 | 9614726 14062 | 14062 | 9614966 14063 | 14063 | 9615079 So running this query: select count(*) from sfd,shawns_data sd where sfd.serial = sd.serial_number and sfd.lid != sd.lid; I should show some rows that do not match, at least 2 (there are more than shown). But instead I get this: count ------- 0 (1 row) What am I doing wrong? -- Sincerely, Shawn Tayler Radio Network Administrator Washoe County Regional Communications System Telecommunications Division Technology Services Department County of Washoe State of Nevada Ofc (775)858-5952 Cell (775)771-4241 FAX (775)858-5960