postgresql/src/backend/commands
Alvaro Herrera fcec6caafa Support XMLTABLE query expression
XMLTABLE is defined by the SQL/XML standard as a feature that allows
turning XML-formatted data into relational form, so that it can be used
as a <table primary> in the FROM clause of a query.

This new construct provides significant simplicity and performance
benefit for XML data processing; what in a client-side custom
implementation was reported to take 20 minutes can be executed in 400ms
using XMLTABLE.  (The same functionality was said to take 10 seconds
using nested PostgreSQL XPath function calls, and 5 seconds using
XMLReader under PL/Python).

The implemented syntax deviates slightly from what the standard
requires.  First, the standard indicates that the PASSING clause is
optional and that multiple XML input documents may be given to it; we
make it mandatory and accept a single document only.  Second, we don't
currently support a default namespace to be specified.

This implementation relies on a new executor node based on a hardcoded
method table.  (Because the grammar is fixed, there is no extensibility
in the current approach; further constructs can be implemented on top of
this such as JSON_TABLE, but they require changes to core code.)

Author: Pavel Stehule, Álvaro Herrera
Extensively reviewed by: Craig Ringer
Discussion: https://postgr.es/m/CAFj8pRAgfzMD-LoSmnMGybD0WsEznLHWap8DO79+-GTRAPR4qA@mail.gmail.com
2017-03-08 12:40:26 -03:00
..
Makefile Logical replication 2017-01-20 09:04:49 -05:00
aggregatecmds.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00
alter.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
amcmds.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
analyze.c Fix relcache reference leak. 2017-03-07 11:27:21 -05:00
async.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00
cluster.c In rebuild_relation(), don't access an already-closed relcache entry. 2017-03-04 16:09:33 -05:00
collationcmds.c Add CREATE COLLATION IF NOT EXISTS clause 2017-02-15 10:01:28 -05:00
comment.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
constraint.c Allow index AMs to cache data across aminsert calls within a SQL command. 2017-02-09 11:52:12 -05:00
conversioncmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
copy.c Avoid dangling pointer to relation name in RLS code path in DoCopy(). 2017-03-06 16:50:47 -05:00
createas.c Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
dbcommands.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
define.c Logical replication 2017-01-20 09:04:49 -05:00
discard.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
dropcmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
event_trigger.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
explain.c Support XMLTABLE query expression 2017-03-08 12:40:26 -03:00
extension.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
foreigncmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
functioncmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
indexcmds.c Ignore tablespace ACLs when ignoring schema ACLs. 2017-02-12 16:03:41 -05:00
lockcmds.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
matview.c Tweak catalog indexing abstraction for upcoming WARM 2017-01-31 18:42:24 -03:00
opclasscmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
operatorcmds.c Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
policy.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
portalcmds.c Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
prepare.c Consistently declare timestamp variables as TimestampTz. 2017-02-23 15:57:08 -05:00
proclang.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
publicationcmds.c Fix typos in comments. 2017-02-06 11:33:58 +02:00
schemacmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
seclabel.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
sequence.c Add CREATE SEQUENCE AS <data type> clause 2017-02-10 15:34:35 -05:00
subscriptioncmds.c Fix connection leak in DROP SUBSCRIPTION command, take 2. 2017-03-08 23:43:38 +09:00
tablecmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
tablespace.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
trigger.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
tsearchcmds.c Provide CatalogTupleDelete() as a wrapper around simple_heap_delete(). 2017-02-01 16:13:30 -05:00
typecmds.c Remove objname/objargs split for referring to objects 2017-03-06 13:31:47 -05:00
user.c Support SCRAM-SHA-256 authentication (RFC 5802 and 7677). 2017-03-07 14:25:40 +02:00
vacuum.c Don't uselessly rewrite, truncate, VACUUM, or ANALYZE partitioned tables. 2017-03-02 17:23:44 +05:30
vacuumlazy.c Allow vacuums to report oldestxmin 2017-03-03 19:18:25 +05:30
variable.c Remove now-dead code for !HAVE_INT64_TIMESTAMP. 2017-02-23 14:04:43 -05:00
view.c Use the new castNode() macro in a number of places. 2017-01-26 16:47:03 -08:00