pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Distinct oddity
Date: Fri, 08 May 2009 15:52:43 -0400
Message-ID: <13494.1241812363@sss.pgh.pa.us> (raw)
In-Reply-To: <C629C7E8.35E64%maximilian.tyrtania@onlinehome.de>
References: <C629C7E8.35E64%maximilian.tyrtania@onlinehome.de>

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



view thread (20+ messages)  latest in thread

Message-ID: <13494.1241812363@sss.pgh.pa.us>
Permalink:  ../13494.1241812363@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13494.1241812363@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, maximilian.tyrtania@onlinehome.de, scott.marlowe@gmail.com
  Subject: Re: Distinct oddity
  In-Reply-To: <13494.1241812363@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox