Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7sk6-00018i-Ga for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Nov 2016 23:38:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c7sk6-0000S4-1s for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Nov 2016 23:38:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c7sjQ-0008A1-Kk for pgsql-bugs@postgresql.org; Fri, 18 Nov 2016 23:38:08 +0000 Received: from [195.159.176.226] (helo=blaine.gmane.org) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1c7sjM-0005kY-HY for pgsql-bugs@postgresql.org; Fri, 18 Nov 2016 23:38:07 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c7sjH-0006ge-Ab for pgsql-bugs@postgresql.org; Sat, 19 Nov 2016 00:37:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-bugs@postgresql.org From: Thomas Kellerer Subject: Re: ORDER BY TABLENAME, possible bug Date: Sat, 19 Nov 2016 00:37:58 +0100 Lines: 35 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.159.176.226 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org David G. Johnston schrieb am 18.11.2016 um 23:48: > > Is this somewhere in the documentation? The only place I could find > where there is a hint of this use, is the Note in Row Constructors in > https://www.postgresql.org/docs/current/static/sql-expressions.html > > that uses a table alias without the .* in an expression: ROW(t, 42) > > ​https://www.postgresql.org/docs/9.6/static/rowtypes.html > > ​"Whenever you create a table, a composite type is also automatically created, with the same name as the table, to represent the table's row type." > > So, its documented and in technically correct location. I'm not sure > if introducing this material in a "tutorial" would be a gain or just > confuse the student. It seems to be something one picks up somehow > (trial and error, mailing list, stumbling upon it in the docs or > elsewhere on the Internet) as one increases their knowledge of SQL to > an intermediate level. I think the chapter about "Select Lists"[1] would be the approriate place to explain this. I would also love to see an explanation there on why "select (a,b,c)" is something different then "select a,b,c" I see far too many people putting the columns of the select list between parentheses and then being confused about the output. I don't know if the Postgres behaviour is mandated by the SQL standard. If it's not, that should be documented, maybe in the chapter I mentioned above or in the compatibility section of SELECT. If that _is_ mandated by the standard, then I think some small note/warning might be useful (especially to newcomers) Thomas [1] https://www.postgresql.org/docs/current/static/queries-select-lists.html -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs