Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E5F0A632209 for ; Fri, 8 May 2009 12:03:04 -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 65164-04 for ; Fri, 8 May 2009 12:03:01 -0300 (ADT) X-Greylist: delayed 00:07:20.130011 by SQLgrey-1.7.6 Received: from web59506.mail.ac4.yahoo.com (web59506.mail.ac4.yahoo.com [76.13.12.165]) by mail.postgresql.org (Postfix) with SMTP id 1B4C5633FFE for ; Fri, 8 May 2009 12:03:00 -0300 (ADT) Received: (qmail 64078 invoked by uid 60001); 8 May 2009 14:55:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s1024; t=1241794537; bh=JptOPXkwRU/3w6ZZ+QSSFhdG4ColFdVQRoM0hWqNfn4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=xawYoTgYIms/H+ParRRUWMEjAFdgKQaHAbc7IScz/ZIcvDd3ijj+8tcRPe8zhQ20Vk5vt1VJ9Q3aCYDH1o+0s+si6n2baVT5q1hPzkT3W3nAXob/2REpzNC39xoI93of6b9p90UHNGpQAW5UU8z8+3UPtlwNw7ChBhnMg3A5D6k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rocketmail.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=MEhAdp+W7ScYYndYZ6J4l4yhnH3urqykCQwtf82+ApYlAvqwgc6eZEf1mR+n4x96w/kKp8E35cjwmRhrkqjULLP6vpJe3+TpKk2ixV6BuciSvOQIAZb8aQLF1ZcI6mhfPQVBhYtOnSEoR7tmYSJ7HGdl4hQLMMRLYAkhfyNC3Ec=; Message-ID: <398183.56536.qm@web59506.mail.ac4.yahoo.com> X-YMail-OSG: bEZEbG4VM1mVOTnJY2yA8Sed6_CqNqKZAOResZdc_QLPedqfZ4pQ8U2L87sEeuJOfBjZdoagOFcA3.GOcW_fpJLpQov0NkVRftmyyQqyXX93DiJJgnQhwDgx4N_YZPgiXzWiRBPcGXn5diIj84Q9HwD0wEGhYN.1WM6XSbclc6fIIv2aHQ3dtJNRYLpJzeaIPea_n6T8f7Eb5hyicBMhQPjR6eJThLpt_OWqp6hydsZEYBzmPDIeNSwryol3BA68H6_dj.6VddSV8.AHpSPRT_ryWFNGGw-- Received: from [208.187.158.94] by web59506.mail.ac4.yahoo.com via HTTP; Fri, 08 May 2009 07:55:35 PDT X-Mailer: YahooMailRC/1277.35 YahooMailWebService/0.7.289.10 References: Date: Fri, 8 May 2009 07:55:35 -0700 (PDT) From: Rob Sargent Subject: Re: Distinct oddity To: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-347498845-1241794535=:56536" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200905/31 X-Sequence-Number: 32523 --0-347498845-1241794535=:56536 Content-Type: text/plain; charset=us-ascii Is firmen a table or a view? ________________________________ From: Scott Marlowe To: Maximilian Tyrtania Cc: pgsql-sql@postgresql.org Sent: Friday, May 8, 2009 5:35:21 AM Subject: Re: [SQL] Distinct oddity 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.com: > >> On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania >> wrote: >>> Hi there, >>> >>> does this look right? >>> >>> FAKDB=# select count(distinct(f.land)) from firmen f where >>> f.typlist='Redaktion'; >>> count >>> ------- >>> 1975 >>> (1 row) >>> >>> FAKDB=# select count(distinct(f.land||'1')) from firmen f where >>> f.typlist='Redaktion'; >>> count >>> ------- >>> 4944 >>> (1 row) >> >> Yeah, that does seem odd. Could it be something like nulls in your >> data set? just guessing really. If you could make a small test case >> 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=# select count(*) from firmen where bezeichnung is null; > count > ------- > 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. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql --0-347498845-1241794535=:56536 Content-Type: text/html; charset=us-ascii
Is firmen a table or a view?


From: Scott Marlowe <scott.marlowe@gmail.com>
To: Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>
Cc: pgsql-sql@postgresql.org
Sent: Friday, May 8, 2009 5:35:21 AM
Subject: Re: [SQL] Distinct oddity

On Fri, May 8, 2009 at 3:28 AM, Maximilian Tyrtania
<maximilian.tyrtania@onlinehome.de> wrote:
> am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marlowe@gmail.com:
>
>> On Thu, May 7, 2009 at 2:21 AM, Maximilian Tyrtania
>> <maximilian.tyrtania@onlinehome.de> wrote:
>>> Hi there,
>>>
>>> does this look right?
>>>
>>> FAKDB=# select count(distinct(f.land)) from firmen f where
>>> f.typlist='Redaktion';
>>>  count
>>> -------
>>>  1975
>>> (1 row)
>>>
>>> FAKDB=# select count(distinct(f.land||'1')) from firmen f where
>>> f.typlist='Redaktion';
>>>  count
>>> -------
>>>  4944
>>> (1 row)
>>
>> Yeah, that does seem odd.  Could it be something like nulls in your
>> data set?  just guessing really.  If you could make a small test case
>> 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=# select count(*) from firmen where bezeichnung is null;
>  count
> -------
>     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.

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

--0-347498845-1241794535=:56536--