Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbX1S-0004pY-Ad for pgsql-admin@arkaria.postgresql.org; Sat, 19 Apr 2014 15:17:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WbX1R-0002Oo-Oy for pgsql-admin@arkaria.postgresql.org; Sat, 19 Apr 2014 15:17:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbX1Q-0002Oh-Ov for pgsql-admin@postgresql.org; Sat, 19 Apr 2014 15:17:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WbX1O-0002im-2O for pgsql-admin@postgresql.org; Sat, 19 Apr 2014 15:17:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s3JFHZtr024745; Sat, 19 Apr 2014 11:17:35 -0400 From: Tom Lane To: =?UTF-8?B?RWzDrWFzIERhdmlk?= cc: pgsql-admin Subject: Re: Default order of select datname from pg_database In-reply-to: References: Comments: In-reply-to =?UTF-8?B?RWzDrWFzIERhdmlk?= message dated "Sat, 19 Apr 2014 02:49:14 -0430" Date: Sat, 19 Apr 2014 11:17:35 -0400 Message-ID: <24744.1397920655@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org =?UTF-8?B?RWzDrWFzIERhdmlk?= 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