From 8c1de5fb0010ae712568f1706b737270c3609bd8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 21 Dec 2006 16:05:16 +0000 Subject: Initial SQL/XML support: xml data type and initial set of functions. --- doc/src/sgml/datatype.sgml | 84 ++++++++----------------------- doc/src/sgml/func.sgml | 111 ++++++++++++++++++++++++++++++++++++++++- doc/src/sgml/installation.sgml | 11 +++- 3 files changed, 141 insertions(+), 65 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index 4bc950acf0..f68714bd20 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -233,6 +233,12 @@ timestamptz date and time, including time zone + + + xml + + XML data + @@ -248,7 +254,8 @@ precision, integer, interval, numeric, decimal, real, smallint, time (with or without time zone), - timestamp (with or without time zone). + timestamp (with or without time zone), + xml. @@ -3358,12 +3365,21 @@ SELECT * FROM pg_attribute - <acronym>XML</> Document Support + <acronym>XML</> Type - - xml + + XML + + The data type xml can be used to store XML data. Its + advantage over storing XML data in, say, a text field is that it + checks the input values for well-formedness, and there are support + functions to perform type-safe operations on it; see . Currently, there is no support for + validation against a specific XML schema. + + XML (Extensible Markup Language) support is not one capability, but a variety of features supported by a database @@ -3378,22 +3394,6 @@ SELECT * FROM pg_attribute - - - Storage - - - - PostgreSQL does not have a specialized XML data type. - Users should store XML documents in ordinary - TEXT fields. If you need the document split apart into - its component parts so each element is stored separately, you must - use a middle-ware solution to do that, but once done, the data - becomes relational and has to be processed accordingly. - - - - Import/Export @@ -3408,21 +3408,6 @@ SELECT * FROM pg_attribute - - Validation - - - - /contrib/xml2 has a function called - xml_is_well_formed() that can be used in a CHECK - constraint to enforce that a field contains well-formed XML. - It does not support validation against a specific XML - schema. A server-side language with XML capabilities - could be used to do schema-specific XML checks. - - - - Indexing @@ -3438,20 +3423,6 @@ SELECT * FROM pg_attribute - - Modification - - - - If an UPDATE does not modify an XML field, - the XML data is shared between the old and new rows. - However, if the UPDATE modifies an XML - field, a full modified copy of the XML field must be - created internally. - - - - Searching @@ -3487,19 +3458,6 @@ SELECT * FROM pg_attribute - - - Missing Features - - - - Missing features include XQuery, SQL/XML syntax (ISO/IEC - 9075-14), and an XML data type optimized for - XML storage. - - - - diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 1e092c4ce7..c2a3409645 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -10741,4 +10741,113 @@ SELECT (pg_stat_file('filename')).modification; + + + XML Functions + + + The functions and function-like expressions described in this + section operate on values of type xml. + + + + <literal>xmlcomment</literal> + + + xmlcomment + + + + xmlcomment(text) + + + + Creates an XML comment. + + + + + <literal>xmlconcat</literal> + + + xmlconcat + + + + xmlconcat(xml, xml, ...) + + + + Combines a list of individual XML values to create a + single value containing an XML forest. + + + + + <literal>xmlelement</literal> + + + xmlelement + + + + xmlelement(name name, xmlattribytes(value AS label, ... ) + , content, ...) + + + + Creates an XML element, allowing the name to be specified. + + + + + <literal>xmlforest</literal> + + + xmlforest + + + + xmlforest(value AS label, ...) + + + + Creates XML elements from columns, using the name of each + column as the name of the corresponding element. + + + + + <literal>xmlpi</literal> + + + xmlpi + + + + xmlpi(name target , content) + + + + Creates an XML processing instruction. + + + + + <literal>xmlroot</literal> + + + xmlroot + + + + xmlroot(xml, version text , standalone yes|no|no value) + + + + Creates the root node of an XML document. + + + + diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 5d071586fc..a56ba9ad9b 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%standalone-include[<productname>PostgreSQL</>]]> @@ -905,6 +905,15 @@ su - postgres </listitem> </varlistentry> + <varlistentry> + <term><option>--with-libxml</option></term> + <listitem> + <para> + Build with libxml, required for SQL/XML support. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><option>--enable-integer-datetimes</option></term> <listitem> -- cgit v1.2.1