-SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF 'TorontoOttawa');
+SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY VALUE 'TorontoOttawa');
xmlexists
------------
- The BY REF clauses have no effect in
- PostgreSQL, but are allowed for SQL conformance and compatibility
- with other implementations. Per SQL standard, the
- first BY REF is required, the second is
- optional. Also note that the SQL standard specifies
- the xmlexists construct to take an XQuery
- expression as first argument, but PostgreSQL currently only
- supports XPath, which is a subset of XQuery.
+ The BY REF or BY VALUE clauses
+ have no effect in
PostgreSQL, but are allowed
+ for compatibility with other implementations. Per the
SQL
+ standard, the one that precedes any argument is required, and indicates
+ the default for arguments that follow, and one may follow any argument to
+ override the default.
+
PostgreSQL ignores
BY REF
+ and passes by value always.
+
+
+ In the
SQL standard, an
xmlexists
+ construct evaluates an expression in the XQuery language, allows passing
+ values for named parameters in the expression as well as for the context
+ item, and does not require the passed values to be documents, or even of
+ XML type.
+ In
PostgreSQL, this construct currently only
+ evaluates an XPath 1.0 expression, and allows passing only one value,
+ which must be an XML document, to be the context item.
xmltable( XMLNAMESPACES(namespace uri AS namespace name, ...),
- row_expression PASSING BY REF document_expression BY REF
+ row_expression PASSING BY { REF | VALUE } document_expression BY { REF | VALUE }
COLUMNS name { type PATH column_expression DEFAULT default_expression NOT NULL | NULL
| FOR ORDINALITY }
, ...
document_expression provides the XML document to
operate on.
- The BY REF clauses have no effect in PostgreSQL,
- but are allowed for SQL conformance and compatibility with other
- implementations.
The argument must be a well-formed XML document; fragments/forests
are not accepted.
+ The BY REF or BY VALUE clauses are
+ accepted, as described for the xmlexists predicate,
+ but ignored; PostgreSQL currently passes XML by value always.