diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-21 11:32:46 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-07-21 11:32:46 -0400 |
| commit | 0ce7676aa03a2501fde949fea211ba5cd84c2ded (patch) | |
| tree | 792173ad0b228f5a08db6aa3edb0dad38dad7aee /doc/src | |
| parent | aaf15e5c1cf8d2c27d2f9841343f00027762cb4e (diff) | |
Make xpath() do something useful with XPath expressions that return scalars.
Previously, xpath() simply returned an empty array if the expression did
not yield a node set. This is useless for expressions that return scalars,
such as one with name() at the top level. Arrange to return the scalar
value as a single-element xml array, instead. (String values will be
suitably escaped.)
This change will also cause xpath_exists() to return true, not false,
for such expressions.
Florian Pflug, reviewed by Radoslaw Smogura
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/func.sgml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 4c163366b26..4c3e232838c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -9275,6 +9275,8 @@ SELECT xml_is_well_formed_document('<pg:foo xmlns:pg="http://postgresql.org/stuf against the XML value <replaceable>xml</replaceable>. It returns an array of XML values corresponding to the node set produced by the XPath expression. + If the XPath expression returns a scalar value rather than a node set, + a single-element array is returned. </para> <para> |
