Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0VfP-0000ES-W6 for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Oct 2016 15:35:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c0VfO-00058T-E7 for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Oct 2016 15:35:30 +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 1c0Vej-0004KL-5C for pgsql-bugs@postgresql.org; Sat, 29 Oct 2016 15:34:49 +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 1c0Vee-0005XH-KV for pgsql-bugs@postgresql.org; Sat, 29 Oct 2016 15:34:47 +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 u9TFYeP9027823; Sat, 29 Oct 2016 11:34:40 -0400 From: Tom Lane To: Francisco Olarte cc: udv.mail@gmail.com, "pgsql-bugs@postgresql.org" Subject: Re: BUG #14405: ORDER BY TABLENAME, possible bug In-reply-to: References: <20161029121906.15993.79158@wrigleys.postgresql.org> Comments: In-reply-to Francisco Olarte message dated "Sat, 29 Oct 2016 16:54:23 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27821.1477755279.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 29 Oct 2016 11:34:39 -0400 Message-ID: <27822.1477755279@sss.pgh.pa.us> X-Pg-Spam-Score: -3.3 (---) 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 Francisco Olarte writes: > Then, I do not remember whether that's a bug or a feature, and have > not been able to see it in the docs, do not even know how to do it ( > tried some places without luck ), so someone more knowledgeable can > point us in the right direction. Yeah: really, "tablename" is a whole-row variable, and "tablename.colname" is an application of a field-selection operation to a composite value, but you're not required to perform such a selection after mentioning a whole-row variable, if it's in a context where the system can do something sensible with a composite value. Another way to say it is that "tablename" and "tablename.*" are interchangeable notations for a composite value representing the table's current row, everywhere except at the top level of a SELECT list, where the standard mandates that "*" references be burst into individual column references. I had thought this was documented someplace, but after trawling our SGML docs the closest thing I can find is the discussion in https://www.postgresql.org/docs/current/static/sql-expressions.html#FIELD-S= ELECTION and that's not terribly explicit. There's also some related material in https://www.postgresql.org/docs/current/static/rowtypes.html but that doesn't seem to state this straight out either. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs