Re: patch: xmltable - proof concept
| От | Alvaro Herrera |
|---|---|
| Тема | Re: patch: xmltable - proof concept |
| Дата | |
| Msg-id | 20160809173048.GA577162@alvherre.pgsql обсуждение исходный текст |
| Ответ на | patch: xmltable - proof concept (Pavel Stehule <pavel.stehule@gmail.com>) |
| Ответы |
Re: patch: xmltable - proof concept
|
| Список | 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 по дате отправления: