Re: [SQL] Odd unfamiliar Postgres SQL syntax - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Odd unfamiliar Postgres SQL syntax
Date
Msg-id 9468.1501527797@sss.pgh.pa.us
Whole thread Raw
In response to [SQL] Odd unfamiliar Postgres SQL syntax  (Sonny <sonny.chee@gmail.com>)
List pgsql-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



pgsql-sql by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [SQL] Odd unfamiliar Postgres SQL syntax
Next
From: Majid Khan
Date:
Subject: [SQL] PostgreSQL connection with Android Studio