Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order. - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Date
Msg-id CAKFQuwZJ2J5V5Dc4DLb7_pbDt8JxGvkXqpHAoBuQ7643egHc4g@mail.gmail.com
Whole thread Raw
In response to Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
List pgsql-sql
On Monday, February 8, 2016, Venkatesan, Sekhar <sekhar.venkatesan@emc.com> wrote:
My concern here is that I want to maintain consistency ( in our application to retain sort order) between different databases.
I don't see the issue in SQL Server and Oracle databases.
"SELECT KH_.r_object_id, KH_.object_name FROM         dbo.dm_location_s AS ZS_ INNER JOIN
                      dbo.dm_sysobject_s AS KH_ ON ZS_.r_object_id = KH_.r_object_id "

The above query is sorted based on the first column in the select list. Same is not happening in PostgreSQL.
Is this something to do with collation setting in database?


ORDER BY is SQL standard.  Add it and call it a day.  You are relying on undocumented implementation details otherwise.

David J. 

pgsql-sql by date:

Previous
From: "Venkatesan, Sekhar"
Date:
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Next
From: Thomas Kellerer
Date:
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.