Re: problem with distinct not distincting... - Mailing list pgsql-general

From Tom Lane
Subject Re: problem with distinct not distincting...
Date
Msg-id 15100.1350489616@sss.pgh.pa.us
Whole thread Raw
In response to problem with distinct not distincting...  (John Beynon <john@kyan.com>)
List pgsql-general
John Beynon <john@kyan.com> writes:
> I have a pretty basic query;
> select distinct on (name) name, length(name) from
> drugs
> where customer_id IS NOT NULL
> order by name;

> which I'd expect to only return me a single drug name if there are
> duplicates, yet I get

> name | length
> ==========
> Roaccutane | 10
> Roaccutane | 10

> table encoding is UTF8...

> I'm scratching my head!

Yeah, me too.  What PG version is this exactly?  What does EXPLAIN
show for the query?  Can you extract a self-contained test case?

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_stats in 9.2
Next
From: Mathew Thomas
Date:
Subject: Re: transaction log file "000000010000097600000051" could not be archived: too many failures