Re: Default order of select datname from pg_database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

Ordering can never be assumed in SQL. If you want a particular order then you need an order by. 

Hope that hopes!

Jason

> On Apr 19, 2014, at 1:19 AM, Elías David <elias.moreno.tec@xxxxxxxxx> wrote:
> 
> Hi all, 
> 
> By any change, does the following query have an "order by" by default when omitted?:
> 
> select datname from pg_database;
> 
> I know you could pass and ORDER BY datname or similar but what I don't know is if by default there's some kind of sort when the order by is omitted.
> 
> I executed that query against one of my servers and while looking at the names it seems complety random, the order is always the same, for instance:
> 
> web2
> template0
> asdf
> basic
> postgres
> web3
> .....
> 
> Does anybody know?
> 
> Thanks in advance!
> 
> -- 
> Elías David.

-- 
 

This transmission contains confidential and privileged information intended 
solely for the party identified above. If you receive this message in 
error, you must not use it or convey it to others. Please destroy it 
immediately and contact the sender at (303) 386-3955 or by return e-mail to 
the sender.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux