Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcFzM-00047I-Ae for pgsql-sql@arkaria.postgresql.org; Mon, 31 Jul 2017 19:04:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dcFzL-0007E3-Td for pgsql-sql@arkaria.postgresql.org; Mon, 31 Jul 2017 19:04:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcFyL-0004DL-1R for pgsql-sql@postgresql.org; Mon, 31 Jul 2017 19:03:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcFyI-0000M5-KR for pgsql-sql@postgresql.org; Mon, 31 Jul 2017 19:03:19 +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 v6VJ3HqA009469; Mon, 31 Jul 2017 15:03:17 -0400 From: Tom Lane To: Sonny cc: pgsql-sql@postgresql.org Subject: Re: Odd unfamiliar Postgres SQL syntax In-reply-to: References: Comments: In-reply-to Sonny message dated "Mon, 31 Jul 2017 09:42:12 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9467.1501527797.1@sss.pgh.pa.us> Date: Mon, 31 Jul 2017 15:03:17 -0400 Message-ID: <9468.1501527797@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Sonny 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