[DOCS] New XML section for documentation

2006-08-25 Thread Bruce Momjian
Here is an new XML section for our SGML documentation.  It explains the
various XML capabilities, if we support them, and how to use them.

Comments?

---


XML Document Support

XML support is not one capability, but a variety of features supported
by a database.  These capabilities include storage, import/export,
validation, indexing, efficiency of modification,  searching,
transformating, and XML to SQL mapping.  PostgreSQL supports some but
not all of these XML capabilities.  Future releases of PostgreSQL will
continue to improve XML support.

Storage
---
PostgreSQL stores XML documents as ordinary text documents.  It does not
split apart XML documents into its component parts and store each
element separately.  You can use middle-ware solutions to do that, but
once done, the data becomes relational and has to be processed
accordingly.

Import/Export
-
Because XML documents are stored as normal text documents, they can be
imported/exported with little complexity.  A simple TEXT field can hold
up to 1 gigabyte of text, and large objects are available for larger
documents.

Validation
--
/contrib/xml2 has a function called xml_valid() that can be used in
a CHECK constraint to enforce that a field contains valid 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

Because XML documents are stored as text, full-text indexing tool
/contrib/tsearch2 can be used to index XML documents.  Of course, the
searches are text searches, with no XML awareness, but tsearch2 can be
used with other XML capabilities to dramatically reduce the amount of
data processed at the XML level.

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 a XML
field, a full modified copy of the XML field must be created internally.

Searching
-
XPath searches are implemented using /contrib/xml2.  It processes XML
text documents and returns results based on the requested query.

Transforming

/contrib/xml2 supports XSL transformations.

XML to SQL Mapping
---
This involves converting XML data to and from relational structures. 
PostgreSQL has no internal support for such mapping, and relies on
external tools to do such conversions.

Missing Features

o  XQuery
o  SQL/XML syntax (ISO/IEC 9075-14)
o  XML data type optimized for XML storage

See also http://www.rpbourret.com/xml/XMLAndDatabases.htm

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] [HACKERS] New XML section for documentation

2006-08-25 Thread David Fetter
On Fri, Aug 25, 2006 at 07:46:57PM -0400, Bruce Momjian wrote:
> Here is an new XML section for our SGML documentation.  It explains
> the various XML capabilities, if we support them, and how to use
> them.
> 
> Comments?

This looks hauntingly similar to Peter's presentation at the
conference. :)  I'd add a http://wiscorp.com/SQLStandards.html to the
reference section.

Speaking of other parts of the SQL:2003 standard, how about one
section each that mentions them?  There's

Part 4: SQL/PSM (Persistent Stored Modules)
Part 9: SQL/MED (Management of External Data) (my favorite)
Part 10: SQL/OLB (Object Language Binding)
Part 11: SQL/Schemata
Part 13: SQL/JRT (Java Routines and Types)

Cheers,
D
-- 
David Fetter <[EMAIL PROTECTED]> http://fetter.org/
phone: +1 415 235 3778AIM: dfetter666
  Skype: davidfetter

Remember to vote!

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [DOCS] [HACKERS] New XML section for documentation

2006-08-25 Thread Bruce Momjian
David Fetter wrote:
> On Fri, Aug 25, 2006 at 07:46:57PM -0400, Bruce Momjian wrote:
> > Here is an new XML section for our SGML documentation.  It explains

> > the various XML capabilities, if we support them, and how to use
> > them.
> > 
> > Comments?
> 
> This looks hauntingly similar to Peter's presentation at the

I used the XML/SQL and validation part from his talk, but the rest was
from earlier email discussions.

> conference. :)  I'd add a http://wiscorp.com/SQLStandards.html to the

This seems to be the best URL, but it seems too detailed:


http://wiscorp.com/H2-2005-197-SC32N1293-WG3_Presentation_for_SC32_20050418.pdf

> reference section.
> 
> Speaking of other parts of the SQL:2003 standard, how about one
> section each that mentions them?  There's
> 
> Part 4: SQL/PSM (Persistent Stored Modules)
> Part 9: SQL/MED (Management of External Data) (my favorite)
> Part 10: SQL/OLB (Object Language Binding)
> Part 11: SQL/Schemata
> Part 13: SQL/JRT (Java Routines and Types)

I don't know anything about them.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [DOCS] [HACKERS] New XML section for documentation

2006-08-25 Thread Bruce Momjian
Euler Taveira de Oliveira wrote:
> Bruce Momjian wrote:
> 
> > Here is an new XML section for our SGML documentation.  It explains the
> > various XML capabilities, if we support them, and how to use them.
> > 
> > Comments?
> > 
> +1. Users often ask this in the mailing lists. Where are you want to
> put this? I'll suggest: FAQ. What do you all think?

Our main documentation.  Once it is there, people will find it rather
than on the FAQ.

> > Missing Features
> > 
> > o  XQuery
> > o  SQL/XML syntax (ISO/IEC 9075-14)
> > o  XML data type optimized for XML storage
> > 
> Another section in TODO?

Perhaps, yea.

-- 
  Bruce Momjian   [EMAIL PROTECTED]
  EnterpriseDBhttp://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] [HACKERS] New XML section for documentation

2006-08-25 Thread Euler Taveira de Oliveira
Bruce Momjian wrote:

> Here is an new XML section for our SGML documentation.  It explains the
> various XML capabilities, if we support them, and how to use them.
> 
> Comments?
> 
+1. Users often ask this in the mailing lists. Where are you want to
put this? I'll suggest: FAQ. What do you all think?

> Missing Features
> 
>   o  XQuery
>   o  SQL/XML syntax (ISO/IEC 9075-14)
>   o  XML data type optimized for XML storage
> 
Another section in TODO?


-- 
  Euler Taveira de Oliveira
  http://www.timbira.com/


---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [DOCS] New XML section for documentation

2006-08-25 Thread Magnus Hagander
> Indexing
> 
> Because XML documents are stored as text, full-text indexing tool
> /contrib/tsearch2 can be used to index XML documents.  Of 
> course, the searches are text searches, with no XML 
> awareness, but tsearch2 can be used with other XML 
> capabilities to dramatically reduce the amount of data 
> processed at the XML level.


You can also use a functional index and /contrib/xml2 to do limited
XPath indexing. (Can't make it "subtree-aware" for example, unless you
are willing to change your queries, but you can index specific xpath
nodes). 


//Magnus

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] New XML section for documentation

2006-08-25 Thread Peter Eisentraut
Bruce Momjian wrote:
> XML Document Support
> 
> XML support is not one capability, but a variety of features
> supported by a database.

database system

> Storage
> ---
> PostgreSQL stores XML documents as ordinary text documents.

It is "possible" to do that, but this sounds like it's done 
automatically or implicitly.  Maybe:

"PostgreSQL does not have a specialized XML data type.  The recommended 
way is to store XML documents as text."

> Import/Export
> -
> Because XML documents are stored as normal text documents, they can
> be imported/exported with little complexity.

Import/export refers to exporting schema data with XML decorations.  Of 
course you can export column data trivially, but that's not what this 
is about.

> Validation
> --
> /contrib/xml2 has a function called xml_valid() that can be used in
> a CHECK constraint to enforce that a field contains valid XML.  It
> does not support validation against a specific XML schema.

Then this is not validation but only checking for well-formedness.  The 
xml2 README says so, in fact.

> Indexing
> 

I think the expression index capability combined with contrib/xml2 is 
more relevant here than the full-text search capability.

> Transforming
> 
> /contrib/xml2 supports XSL transformations.

That's XSLT.

> XML to SQL Mapping
> ---
> This involves converting XML data to and from relational structures.
> PostgreSQL has no internal support for such mapping, and relies on
> external tools to do such conversions.

Are there instances of such tools?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 6: explain analyze is your friend