Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 690CA633D63 for ; Fri, 8 May 2009 08:35:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 63825-06 for ; Fri, 8 May 2009 08:35:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by mail.postgresql.org (Postfix) with ESMTP id 1D644633BB6 for ; Fri, 8 May 2009 08:35:23 -0300 (ADT) Received: by ewy11 with SMTP id 11so2009929ewy.19 for ; Fri, 08 May 2009 04:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=NQs3Du6U6NGd78/n5p1Yh/nEicKanPzF+tH+GPmsfOE=; b=BnrTCX49O+4iNJb1mXUnLVA0xVpW010g/giXb/M/jrEuM06Je8JDrOaJ8FlQqt/kjW kd8I0/tFRt6pvq+cDXHzOV80BxUGP+hlkVdMqCmGWGPmv8cs65/wu42Dd6+j3FRahmOn kfazQQ2tcB7YYnx4UFvt1o9fgsCUmUj3YrMK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=iO8vGbuINuAPboWy2m9n+VhzW44+HiqkThOkNRvKtJxl81z//6GbLYbghjG+KI9ZKu xU9T3MtOpVNo67W3tQoiZJSyw40iTPTGIzpOjXyz/ySfb8DpIlimrlgSeAlCgp7QKi8j o/kv+n6JvMvlYQRPyN8MCcptsyHYu5rduM4/c= MIME-Version: 1.0 Received: by 10.210.41.1 with SMTP id o1mr606018ebo.18.1241782521494; Fri, 08 May 2009 04:35:21 -0700 (PDT) In-Reply-To: References: Date: Fri, 8 May 2009 05:35:21 -0600 Message-ID: Subject: Re: Distinct oddity From: Scott Marlowe To: Maximilian Tyrtania Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.008 tagged_above=0 required=5 tests=AWL=0.008 X-Spam-Level: X-Archive-Number: 200905/26 X-Sequence-Number: 32518 On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania wrote: > am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marlowe@gmail.c= om: > >> On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania >> wrote: >>> Hi there, >>> >>> does this look right? >>> >>> FAKDB=3D# select count(distinct(f.land)) from firmen f where >>> f.typlist=3D'Redaktion'; >>> =A0count >>> ------- >>> =A01975 >>> (1 row) >>> >>> FAKDB=3D# select count(distinct(f.land||'1')) from firmen f where >>> f.typlist=3D'Redaktion'; >>> =A0count >>> ------- >>> =A04944 >>> (1 row) >> >> Yeah, that does seem odd. =A0Could it be something like nulls in your >> data set? =A0just guessing really. =A0If you could make a small test cas= e >> that shows it happening and allows others to reproduce it you're >> likely to get more bites. > > It doesn't seem to be related to null values (which wouldn't explain it > anyway) nor to this particular field... > > FAKDB=3D# select count(*) from firmen where bezeichnung is null; > =A0count > ------- > =A0 =A0 0 > (1 row) That's not the same field as in the original query. > My attempts at reproducing this with a freshly created table failed, of > course. Instead of trying to create a test case from scratch, isolate some rows that cause this, put them in another table, and then pg_dump that one table, cleaned as needed for privacy, here.