RE: [HACKERS] Upgrades for 6.4.1

From: "Stupor Genius" <stuporg(at)erols(dot)com>
To: "Pgsql-Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: [HACKERS] Upgrades for 6.4.1
Date: 1998-12-20 03:41:56
Message-ID: 000801be2bca$b0bfcaa0$ce98accf@darren
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > >> * SELECT DISTINCT i FROM dtest ORDER BY j generates strange output
> >
> > > In my simple test case, it orders by j, then only shows i. Is that
> > > strange?
> >
> > The thing that is "strange" is that you get nonunique values of i,
> > which is definitely a bit unexpected for "SELECT DISTINCT":
> > I don't know whether the SQL standard defines how this combination of
> > features ought to work ... but our current behavior seems fairly
> > surprising...
>
> Re-added to TODO list.

I don't know if I would necessarily call it "strange", more like
"understandable" if you consider the fact that the ORDER BY is being
done first on the data set rather than the distinct.

It would seem to me that the distinct should apply first though.
I would expect the ORDER BY clause to order whatever tuples are
returned by the SELECT, and that would imply doing DISTINCT first.

Just my two cents...
darrenk

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Clark Evans 1998-12-20 04:49:10 SELECT DISTINCT i FROM dtest ORDER BY j
Previous Message Bruce Momjian 1998-12-19 23:37:59 Re: [HACKERS] Upgrades for 6.4.1