Re: patch: xmltable - proof concept - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: patch: xmltable - proof concept
Date
Msg-id CAFj8pRCYt7RcHUQYtyuskJqTdiptci+4mTwCrH3eASbOK23emw@mail.gmail.com
Whole thread Raw
In response to Re: patch: xmltable - proof concept  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers


2016-08-09 19:30 GMT+02:00 Alvaro Herrera <alvherre@2ndquadrant.com>:
Pavel Stehule wrote:

> postgres=# SELECT  xmltable.*
> postgres-#    FROM (SELECT data FROM xmldata) x,
> postgres-#         LATERAL xmltable('/ROWS/ROW'
> postgres(#                          PASSING data
> postgres(#                          COLUMNS id int PATH '@id',
> postgres(#                                   country_name text PATH
> 'COUNTRY_NAME',
> postgres(#                                   country_id text PATH
> 'COUNTRY_ID',
> postgres(#                                   region_id int PATH 'REGION_ID',
> postgres(#                                   size float PATH 'SIZE',
> postgres(#                                   unit text PATH 'SIZE/@unit',
> postgres(#                                   premier_name text PATH
> 'PREMIER_NAME' DEFAULT 'not specified');
> ┌────┬──────────────┬────────────┬───────────┬──────┬──────┬───────────────┐
> │ id │ country_name │ country_id │ region_id │ size │ unit │ premier_name  │
> ╞════╪══════════════╪════════════╪═══════════╪══════╪══════╪═══════════════╡
> │  1 │ Australia    │ AU         │         3 │    ¤ │ ¤    │ not specified │
> │  2 │ China        │ CN         │         3 │    ¤ │ ¤    │ not specified │
> │  3 │ HongKong     │ HK         │         3 │    ¤ │ ¤    │ not specified │
> │  4 │ India        │ IN         │         3 │    ¤ │ ¤    │ not specified │
> │  5 │ Japan        │ JP         │         3 │    ¤ │ ¤    │ Sinzo Abe     │
> │  6 │ Singapore    │ SG         │         3 │  791 │ km   │ not specified │
> └────┴──────────────┴────────────┴───────────┴──────┴──────┴───────────────┘
> (6 rows)

Nice work!

Thank you

Pavel
 

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: 9.6 phrase search distance specification
Next
From: Tom Lane
Date:
Subject: Re: 9.6 phrase search distance specification