Re: select DISTINCT not ordering the returned rows

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: select DISTINCT not ordering the returned rows
Date: 2011-03-02 20:46:50
Message-ID: ikmabt$fm7$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ioana Danes, 02.03.2011 21:35:
> Hi Everyone,
>
> I would like to ask for your help finding a temporary solution for my problem.
> I upgraded postgres from 8.3 to 9.0.3 and I have an issue with the order of the returned rows.
>

The database is free to return rows in any order it thinks is most efficient and you may never rely on any implicit ordering.

If you need your rows sorted in a specific way, you have to use an ORDER BY clause. Everything else is doomed to fail someday.

Regards
Thomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ioana Danes 2011-03-02 21:02:39 Re: select DISTINCT not ordering the returned rows
Previous Message Tom Lane 2011-03-02 20:44:27 Re: select DISTINCT not ordering the returned rows