agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Sonny <sonny.chee@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Odd unfamiliar Postgres SQL syntax
Date: Mon, 31 Jul 2017 15:03:17 -0400
Message-ID: <9468.1501527797@sss.pgh.pa.us> (raw)
In-Reply-To: <CAF1JCQGvmMJiEYssyKe9+PRqrfJNE9yHNfrSvpQkNrW_drQM=Q@mail.gmail.com>
References: <CAF1JCQGvmMJiEYssyKe9+PRqrfJNE9yHNfrSvpQkNrW_drQM=Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
Sonny <sonny.chee@gmail.com> writes:
> Can someone help me understand the following SQL? What does the notation
> (i.keys).n and (i.keys).x mean... as indicated by the <<<=== in the query.
"(i.keys).n" is selecting the column named "n" from the composite-valued
column "i.keys", where "i" is a table alias exposed by the FROM clause.
The reason we don't just write "i.keys.n" is that the SQL standard says
that should mean column "n" in a table "i.keys" exposed by the FROM
clause --- that is, "i" would be a schema name not a table alias, and
"keys" would be a table name not a column name.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (4+ messages)
Message-ID: <9468.1501527797@sss.pgh.pa.us>
Permalink: ../9468.1501527797@sss.pgh.pa.us/
Also on: postgresql.org/message-id/9468.1501527797@sss.pgh.pa.us
reply
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, sonny.chee@gmail.com
Subject: Re: Odd unfamiliar Postgres SQL syntax
In-Reply-To: <9468.1501527797@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox