Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
76c3c59b
Commit
76c3c59b
authored
Jul 07, 2008
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added documentation for function xmlagg.
parent
fbcc69c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletion
+55
-1
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+55
-1
No files found.
doc/src/sgml/func.sgml
View file @
76c3c59b
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
8 2008/07/03 20:58:46 tgl
Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.43
9 2008/07/07 16:11:35 petere
Exp $ -->
<chapter
id=
"functions"
>
<title>
Functions and Operators
</title>
...
...
@@ -8339,6 +8339,60 @@ SELECT xmlroot(xmlparse(document '<?xml version="1.1"?><content>abc</content>'),
</para>
</sect3>
<sect3>
<title><literal>
xmlagg
</literal></title>
<indexterm>
<primary>
xmlagg
</primary>
</indexterm>
<synopsis>
<function>
xmlagg
</function>
(
<replaceable>
xml
</replaceable>
)
</synopsis>
<para>
The function
<function>
xmlagg
</function>
is, unlike the other
functions below, an aggregate function. It concatenates the
input values to the aggregate function call,
like
<function>
xmlconcat
</function>
does.
See
<xref
linkend=
"functions-aggregate"
>
for general information
about aggregate functions.
</para>
<para>
Example:
<screen>
<![CDATA[
CREATE TABLE test (y int, x xml);
INSERT INTO test VALUES (1, '<foo>abc</foo>');
INSERT INTO test VALUES (2, '<bar/>');
SELECT xmlagg(x) FROM test;
xmlagg
----------------------
<foo>abc</foo><bar/>
]]>
</screen>
</para>
<para>
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:
<screen>
<![CDATA[
SELECT xmlagg(x) FROM (SELECT * FROM test ORDER BY y DESC) AS tab;
xmlagg
----------------------
<bar/><foo>abc</foo>
]]>
</screen>
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 (
<literal>
xmlagg(expr ORDER BY expr, expr,
...
</literal>
).
</para>
</sect3>
<sect3>
<title>
XML Predicates
</title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment