From: Tom Lane <tgl@sss.pgh.pa.us>
To: ElĂas David <elias.moreno.tec@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Default order of select datname from pg_database
Date: Sat, 19 Apr 2014 11:17:35 -0400
Message-ID: <24744.1397920655@sss.pgh.pa.us> (raw)
In-Reply-To: <CANNE3r1gyetpfiU_FWRtozD=cif7cphdWgz8RzPYYk-mKTrfVg@mail.gmail.com>
References: <CANNE3r1gyetpfiU_FWRtozD=cif7cphdWgz8RzPYYk-mKTrfVg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
=?UTF-8?B?RWzDrWFzIERhdmlk?= <elias.moreno.tec@gmail.com> 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.
> 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:
An unqualified query is typically going to result in a sequential scan
of the table, so what you're seeing is the current physical order of the
tuples. This might change after adding/deleting/changing the properties
of a database.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, elias.moreno.tec@gmail.com
Subject: Re: Default order of select datname from pg_database
In-Reply-To: <24744.1397920655@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox