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

From Alvaro Herrera
Subject Re: patch: xmltable - proof concept
Date
Msg-id 20160809173048.GA577162@alvherre.pgsql
Whole thread Raw
In response to patch: xmltable - proof concept  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: patch: xmltable - proof concept  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
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!

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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: patch: xmltable - proof concept
Next
From: Bruce Momjian
Date:
Subject: 9.6 phrase search distance specification