Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Venkatesan, Sekhar" <sekhar(dot)venkatesan(at)emc(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Date: 2016-02-09 06:21:12
Message-ID: CAKFQuwZJ2J5V5Dc4DLb7_pbDt8JxGvkXqpHAoBuQ7643egHc4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday, February 8, 2016, Venkatesan, Sekhar <sekhar(dot)venkatesan(at)emc(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Kellerer 2016-02-09 06:43:03 Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Previous Message Venkatesan, Sekhar 2016-02-09 06:14:41 Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.