Re: Distinct oddity - Mailing list pgsql-sql

From Tom Lane
Subject Re: Distinct oddity
Date
Msg-id 13494.1241812363@sss.pgh.pa.us
Whole thread Raw
In response to Re: Distinct oddity  (Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>)
Responses Re: Distinct oddity  (Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>)
List pgsql-sql
Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de> writes:
> am 07.05.2009 20:54 Uhr schrieb Scott Marlowe unter scott.marlowe@gmail.com:
>> 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...

Can you reproduce it in other contexts than specifically count(distinct)?
In particular I'd try
select count(*) from  (select distinct f.bezeichnung from firmen f) ss;
select count(*) from  (select distinct f.bezeichnung||'e' from firmen f) ss;

If those give the same numbers as you're showing here, then the
next step would be to dump out the actual results of the SELECT DISTINCT
queries and compare them --- looking at the actual data values should
give some insight as to what's happening.

BTW, what is the datatype of f.bezeichnung, and what locale are you
running in?
        regards, tom lane


pgsql-sql by date:

Previous
From: Peter Koczan
Date:
Subject: Re: ascii-betical sort order?
Next
From: Emi Lu
Date:
Subject: view vs. tables used to define that view