From: Peter Eisentraut Date: Mon, 7 Jul 2008 15:55:28 +0000 (+0000) Subject: Added documentation for xmlagg function. X-Git-Tag: REL8_3_4~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1f3b687965902dfb68f894a35b9c13996c209e0;p=postgresql Added documentation for xmlagg function. --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index cadbea38ed..92e9e0585a 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -8249,6 +8249,60 @@ SELECT xmlroot(xmlparse(document 'abc'), + + <literal>xmlagg</literal> + + + xmlagg + + + +xmlagg(xml) + + + + The function xmlagg is, unlike the other + functions below, an aggregate function. It concatenates the + input values to the aggregate function call, + like xmlconcat does. + See for general information + about aggregate functions. + + + + Example: +abc'); +INSERT INTO test VALUES (2, ''); +SELECT xmlagg(x) FROM test; + xmlagg +---------------------- + abc +]]> + + + + Note that in the current implementation, the order of the + concatenation is in principle undefined. Making the input values + to be sorted in some other way will usually work, however. For + instance, in the above example, one could influence the order + like so: +abc +]]> + + But this approach is not guaranteed to work in all situations and + in all versions of PostgreSQL. A future version of PostgreSQL + will probably provide an additional feature to control the order + in a proper way (xmlagg(expr ORDER BY expr, expr, + ...). + + + XML Predicates