Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 16E05632B65 for ; Wed, 13 May 2009 09:37:52 -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 30656-09 for ; Wed, 13 May 2009 09:37:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 2CF62632554 for ; Wed, 13 May 2009 09:37:48 -0300 (ADT) Received: from [10.0.0.189] ([217.9.61.84]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1M4DiR3Nzu-0001nI; Wed, 13 May 2009 14:37:45 +0200 User-Agent: Microsoft-Entourage/11.4.0.080122 Date: Wed, 13 May 2009 14:37:43 +0200 Subject: Re: Distinct oddity From: Maximilian Tyrtania To: Tom Lane CC: Message-ID: Thread-Topic: [SQL] Distinct oddity Thread-Index: AcnTx5w92o8VOD+6Ed6YDgAjMt4/tA== In-Reply-To: <6111.1241879627@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Provags-ID: V01U2FsdGVkX19LiY/UOvNUqeOku6ko6t3p0OjwG3Pju5PoLuA J6Yc/EmYQ0Rgglyj8YWbuBzlo3a7XslNVDrjjFE6ejMtqadeLs cUlr3VVRYHShDiZf+VDElU/JR+0QZjPQAnFNwGQanmC48SfNL0 e5A== 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: 200905/61 X-Sequence-Number: 32553 am 09.05.2009 16:33 Uhr schrieb Tom Lane unter tgl@sss.pgh.pa.us: > What you need to do is > dump out the *entire* results of the DISTINCT queries and look for the > unmatched lines. I'd try dumping to two files, stripping the 'e' with > sed, and then sort/diff. Okay, that's what I did, and the results are, well, surprising (for me, mind you). FAKDB=# \o /withapp FAKDB=# select distinct f.bezeichnung||'$' from firmen f order by 1; FAKDB=# \o /withoutapp FAKDB=# select distinct f.bezeichnung from firmen f order by 1; Opened those files (with textwrangler, as I 've never used sed), stripped off the '$', sorted and looked at the differences (using textwranglers "compare documents"-feature). The file "withoutapp" has those lines: "Abendschau" "Abendschau" They don't look distinct to me. The "Abendschau"-Entry appears only once in "withapp". But then again the "withapp" file has these entries: Adformatie Adformatie which in turn only appear once in "withoutapp". I turned "show invisibles" on in textwrangler, so I don't think there is some gremlin business going on. Actually I'm interested in but in no way dependant on what's going on here, I just thought as a good pg-citizen I should report whatever might be wrong. Best, Maximilian Tyrtania