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

From Sonny
Subject [SQL] Odd unfamiliar Postgres SQL syntax
Date
Msg-id CAF1JCQGvmMJiEYssyKe9+PRqrfJNE9yHNfrSvpQkNrW_drQM=Q@mail.gmail.com
Whole thread Raw
Responses Re: [SQL] Odd unfamiliar Postgres SQL syntax
Re: [SQL] Odd unfamiliar Postgres SQL syntax
Re: [SQL] Odd unfamiliar Postgres SQL syntax
List pgsql-sql
Hey Guys

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.  Any help would be appreciated.


SELECT
  NULL AS TABLE_CAT
  , n.nspname AS TABLE_SCHEM
  ,   ct.relname AS TABLE_NAME
  , a.attname AS COLUMN_NAME
  ,   (i.keys).n AS KEY_SEQ      <<<==============
  , ci.relname AS PK_NAME
FROM
  pg_catalog.pg_class ct  
  JOIN pg_catalog.pg_attribute a
    ON (ct.oid = a.attrelid)  
  JOIN pg_catalog.pg_namespace n
    ON (ct.relnamespace = n.oid)  
  JOIN (
    SELECT
      i.indexrelid
      , i.indrelid
      , i.indisprimary
      , information_schema._pg_expandarray(i.indkey) AS keys        
    FROM pg_catalog.pg_index i
    ) i    
    ON (a.attnum = (i.keys).x AND a.attrelid = i.indrelid)    <<<===========
  JOIN pg_catalog.pg_class ci
    ON (ci.oid = i.indexrelid)
WHERE
  n.nspname = 'edw'
  AND ct.relname = 'campaign_dim'
  AND i.indisprimary 
ORDER BY
  table_name
  , pk_name
  , key_seq;

--
Sonny.
----------------------------------------------------------------------------
Be true to your work, your word, and your friend. Henry David Thoreau.

pgsql-sql by date:

Previous
From: srilinux
Date:
Subject: [SQL] Database duplicate copy
Next
From: "David G. Johnston"
Date:
Subject: Re: [SQL] Odd unfamiliar Postgres SQL syntax