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

From John Beynon
Subject problem with distinct not distincting...
Date
Msg-id CABvXOHpNO4rpC+b1EVC6SQstp3rCDZ3+WcCWMqcPvytKOxbw0Q@mail.gmail.com
Whole thread Raw
Responses Re: problem with distinct not distincting...  ("David Johnston" <polobo@yahoo.com>)
Re: problem with distinct not distincting...  (Susan Cassidy <scassidy@edgewave.com>)
Re: problem with distinct not distincting...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: problem with distinct not distincting...  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
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!

Thanks,

John.


pgsql-general by date:

Previous
From: "amitkapila [via PostgreSQL]"
Date:
Subject: Re: How to avoid base backup in automated failover
Next
From: "chinnaobi [via PostgreSQL]"
Date:
Subject: Re: How to avoid base backup in automated failover