Re: Default order of select datname from pg_database

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Default order of select datname from pg_database
Date: 2014-04-19 15:44:51
Message-ID: 1397922291602-5800802.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom Lane-2 wrote
> =?UTF-8?B?RWzDrWFzIERhdmlk?= &lt;

> elias.moreno.tec@

> &gt; writes:
>> By any change, does the following query have an "order by" by default
>> when
>> omitted?:
>
>> select datname from pg_database;
>
> No. No SQL query ever has a "default" order by.

While not applicable here you can define a view to include an order by so
that a plain select on the view is indeed ordered even though the explicit
code provided by the user does not specify an order.

I'm doubting, though, that any of the information schema views do this.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Default-order-of-select-datname-from-pg-database-tp5800783p5800802.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Elías David 2014-04-19 16:39:31 Re: Default order of select datname from pg_database
Previous Message Tom Lane 2014-04-19 15:17:35 Re: Default order of select datname from pg_database