Re: patch: function xmltable
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Craig Ringer <craig@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2016-11-23T16:54:48Z
Lists: pgsql-hackers
I tried to see if a following RTE was able to "see" the entries created by
XMLTABLE, and sure it can:
SELECT X.*, generate_series
FROM emp,
XMLTABLE ('//depts/dept/employee' passing doc
COLUMNS
empID INTEGER PATH '@id',
firstname varchar(25) PATH 'name/first',
lastname VARCHAR(25) PATH 'name/last') AS X,
generate_series(900, empid);
empid │ firstname │ lastname │ generate_series
───────┼───────────┼──────────┼─────────────────
901 │ John │ Doe │ 900
901 │ John │ Doe │ 901
902 │ Peter │ Pan │ 900
902 │ Peter │ Pan │ 901
902 │ Peter │ Pan │ 902
903 │ Mary │ Jones │ 900
903 │ Mary │ Jones │ 901
903 │ Mary │ Jones │ 902
903 │ Mary │ Jones │ 903
(9 filas)
Cool.
I'm still wondering how this works. I'll continue to explore the patch
in order to figure out.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Support XMLTABLE query expression
- fcec6caafa23 10.0 landed
-
Create <sect3> in the functions-xml section
- 4461a9bfd1ac 10.0 landed
-
Improve handling of "UPDATE ... SET (column_list) = row_constructor".
- 906bfcad7ba7 10.0 cited
-
Add xmlexists function
- 641459f26954 9.1.0 cited