From: Tom Lane <tgl@sss.pgh.pa.us>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: udv.mail@gmail.com, "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14405: ORDER BY TABLENAME, possible bug
Date: Sat, 29 Oct 2016 11:34:39 -0400
Message-ID: <27822.1477755279@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+bJJbz=7rU1r94PLTt0MiPJJGsitybF6TR8HNpXkC5La_uGTg@mail.gmail.com>
References: <20161029121906.15993.79158@wrigleys.postgresql.org>
<CA+bJJbz=7rU1r94PLTt0MiPJJGsitybF6TR8HNpXkC5La_uGTg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Francisco Olarte <folarte@peoplecall.com> 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-SELECTION
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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, folarte@peoplecall.com
Subject: Re: BUG #14405: ORDER BY TABLENAME, possible bug
In-Reply-To: <27822.1477755279@sss.pgh.pa.us>
References: <20161029121906.15993.79158@wrigleys.postgresql.org> <CA+bJJbz=7rU1r94PLTt0MiPJJGsitybF6TR8HNpXkC5La_uGTg@mail.gmail.com> <27822.1477755279@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