Re: select DISTINCT not ordering the returned rows - Mailing list pgsql-general

From Tom Lane
Subject Re: select DISTINCT not ordering the returned rows
Date
Msg-id 14031.1299098667@sss.pgh.pa.us
Whole thread Raw
In response to select DISTINCT not ordering the returned rows  (Ioana Danes <ioanasoftware@yahoo.ca>)
Responses Re: select DISTINCT not ordering the returned rows  (Ioana Danes <ioanasoftware@yahoo.ca>)
List pgsql-general
Ioana Danes <ioanasoftware@yahoo.ca> writes:
> I upgraded postgres from 8.3 to 9.0.3 and I have an issue with the order of the returned rows.

Your application is simply broken if it assumes that DISTINCT results in
ordering the rows.  The only thing that guarantees that is an ORDER BY.

You could probably work around it for the short term by unsetting
enable_hashagg, but you really ought to fix the query instead.

            regards, tom lane

pgsql-general by date:

Previous
From: Ioana Danes
Date:
Subject: Re: select DISTINCT not ordering the returned rows
Next
From: Thomas Kellerer
Date:
Subject: Re: select DISTINCT not ordering the returned rows