Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8db61f

Browse files
committed
Add XML documentation.
1 parentd511134 commita8db61f

File tree

1 file changed

+149
-1
lines changed

1 file changed

+149
-1
lines changed

‎doc/src/sgml/datatype.sgml

Lines changed: 149 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.171 2006/08/21 16:23:46 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.172 2006/09/07 00:04:48 momjian Exp $ -->
22

33
<chapter id="datatype">
44
<title id="datatype-title">Data Types</title>
@@ -3295,6 +3295,154 @@ SELECT * FROM pg_attribute
32953295

32963296
</sect1>
32973297

3298+
<sect1 id="datatype-xml">
3299+
<title><acronym>XML</> Document Support</title>
3300+
3301+
<indexterm zone="datatype">
3302+
<primary>xml</primary>
3303+
</indexterm>
3304+
3305+
<para>
3306+
<acronym>XML</> (eXtensible Markup Language) support is not one
3307+
capability, but a variety of features supported by a database
3308+
system. These capabilities include storage, import/export,
3309+
validation, indexing, efficiency of modification, searching,
3310+
transforming, and <acronym>XML</> to <acronym>SQL</> mapping.
3311+
<productname>PostgreSQL</> supports some but not all of these
3312+
<acronym>XML</> capabilities. Future releases of
3313+
<productname>PostgreSQL</> will continue to improve <acronym>XML</>
3314+
support. For an overview of <acronym>XML</> use in databases, see <ulink
3315+
url="http://www.rpbourret.com/xml/XMLAndDatabases.htm"></>.
3316+
</para>
3317+
3318+
<variablelist>
3319+
3320+
<varlistentry>
3321+
<term>Storage</term>
3322+
<listitem>
3323+
3324+
<para>
3325+
PostgreSQL does not have a specialized <acronym>XML</> data type.
3326+
Users should store <acronym>XML</> documents in ordinary
3327+
<type>TEXT</> fields. If you need the document split apart into
3328+
its component parts so each element is stored separately, you must
3329+
use a middle-ware solution to do that, but once done, the data
3330+
becomes relational and has to be processed accordingly.
3331+
</para>
3332+
</listitem>
3333+
</varlistentry>
3334+
3335+
<varlistentry>
3336+
<term>Import/Export</term>
3337+
<listitem>
3338+
3339+
<para>
3340+
There is no facility for mapping <acronym>XML</> to relational
3341+
tables. An external tool must be used for this. One simple way to
3342+
export <acronym>XML</> is to use <application>psql</> in
3343+
<acronym>HTML</> mode (<literal>\pset format html</>), and convert
3344+
the <acronym>XHTML</> output to XML using an external tool.
3345+
</para>
3346+
</listitem>
3347+
</varlistentry>
3348+
3349+
<varlistentry>
3350+
<term>Validation</term>
3351+
<listitem>
3352+
3353+
<para>
3354+
<filename>/contrib/xml2</> has a function called
3355+
<function>xml_valid()</> that can be used in a <literal>CHECK</>
3356+
constraint to enforce that a field contains valid <acronym>XML</>.
3357+
It does not support validation against a specific <acronym>XML</>
3358+
schema. A server-side language with <acronym>XML</> capabilities
3359+
could be used to do schema-specific <acronym>XML</> checks.
3360+
</para>
3361+
</listitem>
3362+
</varlistentry>
3363+
3364+
<varlistentry>
3365+
<term>Indexing</term>
3366+
<listitem>
3367+
3368+
<para>
3369+
<filename>/contrib/xml2</> functions can be used in expression
3370+
indexes to index specific <acronym>XML</> fields. To index the
3371+
full contents of <acronym>XML</> documents, the full-text indexing
3372+
tool <filename>/contrib/tsearch2</> can be used. Of course,
3373+
tsearch2 indexes have no <acronym>XML</> awareness so additional
3374+
<filename>/contrib/xml2</> checks should be added to queries.
3375+
</para>
3376+
</listitem>
3377+
</varlistentry>
3378+
3379+
<varlistentry>
3380+
<term>Modification</term>
3381+
<listitem>
3382+
3383+
<para>
3384+
If an <command>UPDATE</> does not modify an <acronym>XML</> field,
3385+
the <acronym>XML</> data is shared between the old and new rows.
3386+
However, if the <command>UPDATE</> modifies an <acronym>XML</>
3387+
field, a full modified copy of the <acronym>XML</> field must be
3388+
created internally.
3389+
</para>
3390+
</listitem>
3391+
</varlistentry>
3392+
3393+
<varlistentry>
3394+
<term>Searching</term>
3395+
<listitem>
3396+
3397+
<para>
3398+
XPath searches are implemented using <filename>/contrib/xml2</>.
3399+
It processes <acronym>XML</> text documents and returns results
3400+
based on the requested query.
3401+
</para>
3402+
</listitem>
3403+
</varlistentry>
3404+
3405+
<varlistentry>
3406+
<term>Transforming</term>
3407+
<listitem>
3408+
3409+
<para>
3410+
<filename>/contrib/xml2</> supports <acronym>XSLT</> (XML
3411+
Stylesheet Language Transformation).
3412+
</para>
3413+
</listitem>
3414+
</varlistentry>
3415+
3416+
<varlistentry>
3417+
<term>XML to SQL Mapping</term>
3418+
<listitem>
3419+
3420+
<para>
3421+
This involves converting <acronym>XML</> data to and from
3422+
relational structures. <productname>PostgreSQL</> has no internal
3423+
support for such mapping, and relies on external tools to do such
3424+
conversions.
3425+
</para>
3426+
</listitem>
3427+
</varlistentry>
3428+
3429+
<varlistentry>
3430+
<term>Missing Features</term>
3431+
<listitem>
3432+
3433+
<para>
3434+
Missing features include XQuery, SQL/XML syntax (ISO/IEC
3435+
9075-14), and an <acronym>XML</> data type optimized for
3436+
<acronym>XML</> storage.
3437+
3438+
</para>
3439+
</listitem>
3440+
</varlistentry>
3441+
3442+
</variablelist>
3443+
3444+
</sect1>
3445+
32983446
</chapter>
32993447

33003448
<!-- Keep this comment at the end of the file

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp