Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c7sf5-0000xo-Sl for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Nov 2016 23:33:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c7sf4-0006qV-7Q for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Nov 2016 23:33:38 +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 1c7sf3-0006pw-1Y for pgsql-bugs@postgresql.org; Fri, 18 Nov 2016 23:33:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c7sez-0005f6-75 for pgsql-bugs@postgresql.org; Fri, 18 Nov 2016 23:33:36 +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 uAINXUTW009268; Fri, 18 Nov 2016 18:33:30 -0500 From: Tom Lane To: "David G. Johnston" cc: Pantelis Theodosiou , Pavel Stehule , dv , "pgsql-bugs@postgresql.org" Subject: Re: ORDER BY TABLENAME, possible bug In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Fri, 18 Nov 2016 15:48:42 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <9266.1479512010.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 18 Nov 2016 18:33:30 -0500 Message-ID: <9267.1479512010@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) 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" writes: > On Fri, Nov 18, 2016 at 3:35 PM, Pantelis Theodosiou > wrote: >> Is this somewhere in the documentation? > ​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. There's a whole bunch of behaviors around composite values that are documented in scattered places, some of which are completely not where you'd expect to look. In this example, the fact that you can use a table name/alias to represent the composite value of the current row is something that isn't exactly obvious, much less how that relates to other possible spellings such as "TABLENAME.*". We had a related question just a couple weeks ago, which caused me to wonder (not for the first time) whether we could pull together some sort of unified presentation. I haven't done anything about it though. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs