SlideShare uma empresa Scribd logo
1 de 54
Baixar para ler offline
The Road to the XML Type
  Current and Future Developments


Nikolay Samokhvalov   Peter Eisentraut



            PGCon 2007
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


Past Developments



     contrib/xml2 by J. Gray et al.
     Initial patch for SQL/XML publishing functions by Pavel
     Stehule
     Google Summer of Code 2006 - Nikolay Samokhvalov
     Initial version of export functions by Peter Eisentraut




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


New Features



  Target for PostgreSQL 8.3:
      XML Data Type
      XML Publishing
      XML Export
      SQL:2003 conformance
      XPath




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


Outline

  1   Past Developments
  2   Current Developments
        XML Data Type
        XML Publishing
        XML Export
        XPath
  3   Future Developments
  4   Use Cases
  5   Conclusion


          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


XML Data Type

  CREATE TABLE test (
      ...,
      data xml,
      ...
  );

  Features:
      Input checking
      Support functions
  Issues:
      Internal storage format (plain text)
      Encoding handling
          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


Using the XML Type
  Bizarre SQL way:
  INSERT INTO test VALUES (
      ...,
      XMLPARSE (DOCUMENT ’<foo>...</foo>’),
      ...
  );

  SELECT XMLSERIALIZE (DOCUMENT data AS varchar)
      FROM test;

  Simple PostgreSQL way:
  INSERT INTO test VALUES (... , ’<foo>...</foo>’, ...);

  SELECT data FROM test;

         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


XML Type Oddities



     No comparison operators
     To retrieve, use:
         Cast to text, or
         XPath, or
         Other key column
     To index, use:
         Cast to text, or
         XPath




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


Outline

  1   Past Developments
  2   Current Developments
        XML Data Type
        XML Publishing
        XML Export
        XPath
  3   Future Developments
  4   Use Cases
  5   Conclusion


          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


Producing XML Content

  The old way?

  SELECT ’<record id=quot;’ || id || ’quot;><value>’
         || ad_hoc_escape_func(value)
         || ’</value></record>’
      FROM tab;

  The new way:

  SELECT XMLELEMENT(NAME record,
                    XMLATTRIBUTES(id),
                    XMLELEMENT(NAME value, value))
      FROM tab;


         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


XMLELEMENT Example
 SQL:                                             Result:
 XMLROOT (                                        <?xml version=’1.0’
   XMLELEMENT (                                         standalone=’yes’ ?>
      NAME ’gazonk’,                              <gazonk name=’val’
      XMLATTRIBUTES (                                     num=’2’>
        ’val’ AS ’name’,                            <qux>foo</qux>
        1 + 1 AS ’num’                            </gazonk>
      ),
      XMLELEMENT (
        NAME ’qux’,
        ’foo’
      )
   ),
   VERSION ’1.0’,
   STANDALONE YES
 )
         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                    XML Data Type
                           Current Developments
                                                    XML Publishing
                            Future Developments
                                                    XML Export
                                     Use Cases
                                                    XPath
                                     Conclusion


XMLFOREST Example

 SELECT xmlforest (
   quot;FirstNamequot; as quot;FNamequot;, quot;LastNamequot; as quot;LNamequot;,
   ’string’ as quot;strquot;, quot;Titlequot;, quot;Regionquot; )
 FROM quot;Demoquot;.quot;demoquot;.quot;Employeesquot;;

 might result in
 <FName>Nancy</FName>
 <LName>Davolio</LName>
 <str>string</str>
 <Title>Sales Representative</Title>
 <Region>WA</Region>
 . . .
 <FName>Anne</FName>
 <LName>Dodsworth</LName>
 <str>string</str>
 <Title>Sales Representative</Title>



 (1 row per record)
            Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                   XML Data Type
                          Current Developments
                                                   XML Publishing
                           Future Developments
                                                   XML Export
                                    Use Cases
                                                   XPath
                                    Conclusion


XMLAGG Example
 SELECT xmlelement (’Emp’,
   xmlattributes (’Sales Representative’ as quot;Titlequot;),
   xmlagg (xmlelement (’Name’, quot;FirstNamequot;, ’ ’, quot;LastNamequot;)))
   FROM quot;Demoquot;.quot;demoquot;.quot;Employeesquot;
   WHERE quot;Titlequot; = ’Sales Representative’;

 might result in
 <Emp Title=quot;Sales Representativequot;>
   <Name>Nancy Davolio</Name>
   <Name>Janet Leverling</Name>
   <Name>Margaret Peacock</Name>
   <Name>Michael Suyama</Name>
   <Name>Robert King</Name>
   <Name>Anne Dodsworth</Name>
 </Emp>

 (1 row)
           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


Outline

  1   Past Developments
  2   Current Developments
        XML Data Type
        XML Publishing
        XML Export
        XPath
  3   Future Developments
  4   Use Cases
  5   Conclusion


          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                   XML Data Type
                          Current Developments
                                                   XML Publishing
                           Future Developments
                                                   XML Export
                                    Use Cases
                                                   XPath
                                    Conclusion


XML Export


      Map table/schema/database contents to XML document
      Map table/schema/database schema to XML Schema
  Useful for:
      Downstream processing (e.g., SOAP, web services)
      Postprocessing using XSLT
      Backup???
      Display formats (alternative to psql’s HTML mode)




           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


XML Export Functions
  Data export:
  table_to_xml(tbl regclass, nulls boolean,
               tableforest boolean, targetns text)
  query_to_xml(query text, nulls boolean,
               tableforest boolean, targetns text)
  cursor_to_xml(cursor refcursor, count int, nulls boolean,
                tableforest boolean, targetns text)

  Schema export:
  table_to_xmlschema(tbl regclass, nulls boolean,
                     tableforest boolean, targetns text)
  query_to_xmlschema(query text, nulls boolean,
                     tableforest boolean, targetns text)
  cursor_to_xmlschema(cursor refcursor, nulls boolean,
                      tableforest boolean, targetns text)

          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                     XML Data Type
                            Current Developments
                                                     XML Publishing
                             Future Developments
                                                     XML Export
                                      Use Cases
                                                     XPath
                                      Conclusion


XML Schema Mapping Example

  CREATE TABLE test (a int PRIMARY KEY, b varchar(200));

  is mapped to
  <xsd:complexType name=quot;RowType.catalog.schema.testquot;>
    <xsd:sequence>
      <xsd:element name=quot;aquot; type=quot;INTEGERquot;></xsd:element>
      <xsd:element name=quot;bquot; type=quot;VARCHAR_200_200quot; minOccurs=quot;0quot;></xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name=quot;TableType.catalog.schema.testquot;>
    <xsd:sequence>
      <xsd:element name=quot;rowquot;
          type=quot;RowType.catalog.schema.testquot;
          minOccurs=quot;0quot;
          maxOccurs=quot;unboundedquot; />
    </xsd:sequence>
  </xsd:complexType>




             Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


XML Export Format Example

  <catalogname>
    <schemaname>
      <tablename>
        <row>
          <colname1>value</colname1>
          <colname2 xsi:nil=’true’/>
          ...
        </row>
        ...
      </tablename>
      ...
    </schemaname>
    ...
  </catalogname>


         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


Outline

  1   Past Developments
  2   Current Developments
        XML Data Type
        XML Publishing
        XML Export
        XPath
  3   Future Developments
  4   Use Cases
  5   Conclusion


          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


XPath example



  The table for further examples:
  CREATE TABLE table1(
     id INTEGER PRIMARY KEY,
     created TIMESTAMP NOT NULL
         DEFAULT CURRENT_TIMESTAMP,
     xdata XML
  );




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


XPath Example
  Sample data:
  INSERT INTO
     table1(id, xdata)
     VALUES(
     1,
     ’<dept xmlns:smpl=quot;http://example.comquot; smpl:did=quot;DPT011-ITquot;>
        <name>IT</name>
        <persons>
          <person smpl:pid=quot;111quot;>
            <name>John Smith</name>
            <age>24</age>
            </person>
            <person smpl:pid=quot;112quot;>
              <name>Michael Black</name>
              <age>28</age>
            </person>
        </persons>
     </dept>’
  );

          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


XPath Example

  Simple example:
  SELECT *
  FROM table1
  WHERE (xpath(’//person/name/text()’,
               xdata))[1]::text = ’John Smith’;

  And using namespaces:
  xmltest=# SELECT *
  FROM table1
  WHERE (xpath(’//person/@smpl:pid’, xdata,
    ARRAY[ARRAY[’smpl’, ’http://example.com’]]))::text = ’111’
  FROM table1;



         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                  XML Data Type
                         Current Developments
                                                  XML Publishing
                          Future Developments
                                                  XML Export
                                   Use Cases
                                                  XPath
                                   Conclusion


XPath: Indexes




  Use functional indexes to avoid XPath evaluation at runtime:
  CREATE INDEX i_table1_xdata ON table1 USING btree(
     xpath(’//person/@name’, xdata)
  );




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                                                 XML Data Type
                        Current Developments
                                                 XML Publishing
                         Future Developments
                                                 XML Export
                                  Use Cases
                                                 XPath
                                  Conclusion


External Dependencies




     Uses libxml (MIT License) for XML publishing and XPath
     Enable with configure --with-libxml
     Not necessary for XML export




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


Future Developments


     DTD and XML Schema validation
     Annotated schema decomposition
     XSLT
     Performance issues
     Full-Text Search
     Advanced Indexing (XLABEL)
     More, More, More




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


DTD and XML Schema validation

  DTD validation:
      Implemented for 8.3, DTD is passed by URI
      Should be extended to allow passing DTD as text

  XML Schema (XSD) validation (XMLVALIDATE per SQL:2006):
  INSERT INTO messages(msg)
  SELECT xmlvalidate(
     DOCUMENT ’<?xml ...’
     ACCORDING TO XMLSCHEMA NO NAMESPACE
     LOCATION ’http://mycompany.com/msg-schema’
  );

  The result of XMLVALIDATE is new XML value!
          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Annotated schema decomposition

  In some cases decomposition is better (no needs in storing
  XML data, XML serves as transport only):
      When we need to store only small parts of the XML data
      Already developed tools might be designed only for
      relational data
  During decomposition following capabilities could be used:
      Data normalization
      Foreign keys creation
      Conditional insertion of data chunks
      Insert parts of initial XML document as XML values


          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                          Current Developments
                           Future Developments
                                    Use Cases
                                    Conclusion


XSLT



 The easiest way: adapt and expand contrib/xml2’s
 capabilities. We should choose one of two:

       Move XSLT functionality to the core (and use
       --with-libxslt)
       Separate contrib/xslt




           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                          Current Developments
                           Future Developments
                                    Use Cases
                                    Conclusion


Performance issues

  Ideas:
      Cache intermediate results to avoid redundant parsing and
      XPath evaluation
      Advanced physical storage to speedup access to arbitrary
      node in XML data
      Use PostgreSQL existing capabilities for full-text search
      Use additional structures/tables/indexes to avoid XPath
      evaluation at runtime
      Use slices (similar to array_extract_slice()) to avoid
      dealing with entire values (both in SELECTs and
      UPDATEs)

           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Full-Text Search


  Simple way to create FTS index (available in 8.3):
  CREATE INDEX i_table1_fts ON table1
  USING gist(
     to_tsvector(
       ’default’,
       array_to_string(xpath(’//text()’, xdata), ’ ’)
     )
  );




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Full-Text Search

  Proposal for overloading of built-in to_tsvector():
  CREATE OR REPLACE FUNCTION to_tsvector(text, xml)
  RETURNS tsearch2.tsvector
  AS $BODY$
    SELECT to_tsvector(
       $1,
       array_to_string(xpath(’//text()’, $2), ’ ’)
    );
  $BODY$ LANGUAGE sql IMMUTABLE;

  CREATE INDEX i_table1_fts
  ON table1
  USING gist(to_tsvector(’default’, xdata));



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                          Current Developments
                           Future Developments
                                    Use Cases
                                    Conclusion


Full-Text Search



  Further ideas for full-text search:
      Indexing parts of documents (available in 8.3, in some way)
      Element names in tsvector
      Relevance Scoring (ranking)
      FTS parser for XML




           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


XLABEL

 Idea:
     Enumerate all XML node names in one database-wide
     table (xnames)
     Store shredded data in additional table
     (columnname_xlabel)
     Use numbering scheme (in prototype it’s ltree, then SLS)
     encode nodes
     Use GiST/GIN indexes for numbering scheme column
     Rewrite XPath expression to plain SQL statement
     Implement partial updates support to avoid massive index
     rebuilding

         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


XLABEL

 Enumerate all XML node names in the database:

                                     Table: xnames

                           xname_id              xname_name
                           1                     person
                           2                     dept
                           3                     name
                           4                     did
                           5                     persons
                           ...                   ...




         Nikolay Samokhvalov, Peter Eisentraut    The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


XLABEL
 For an XML column implicitly create additional table (using
 xlabel.register_column() function):

                              Table: table1_xdata

        tid     xlabel              node_type       xname_id         value
        1       a                   1 (elem.)       2                NULL
        1       a.b                 2 (attr.)       4                DPT011-IT
        1       a.c                 1 (elem.)       3                NULL
        1       a.c.a               NULL            NULL             IT
        ...     ...                 ...             ...              ...
        1       a.d.a.b             1 (elem.)       3                NULL
        1       a.d.a.b.a           NULL            NULL             John Smith
        ...     ...                 ...             ...              ...


 CREATE INDEX i_table1_xdata_xlabel
 ON table1_xdata
 USING gist(xlabel);
         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


XLABEL
 Rewrite XPath expression to plain SQL statement:
 SELECT *
 FROM table1
 WHERE array_dims(xpath(’//person/name’, xdata)) IS NOT NULL;

 ... becomes ...
 SELECT *
 FROM table1
 WHERE EXISTS(
    SELECT 1
    FROM table1_xdata AS t1, table1_xdata AS t2
    WHERE t1.xname_id = 1 AND t2.xname_id = 3
          AND t3.xlabel <@ t1.xlabel
 );

 ... where <@ means “is a child of”
          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


XLABEL



 Current thoughts:
     Separate table is not good (deja vu: fti VS tsearch2)
     It would be great if one structure solves 2 problems at
     once:
         access to arbitrary node
         SELECTs with XPath




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


More, more, more

     Inline ORDER BY for XMLAGG (SQL:2003)
     ... XMLAGG(XMLELEMENT(...) ORDER BY col1) ...
     XMLCAST (SQL:2006)
     XML Canonical
     Pretty-printing XML
     Registered XML Schemas (SQL:2006)
     Schema evolution
     Improve Data Model (XDM)
     XQuery Support (SQL:2006)
     Updatable XML views (over relational data)
     RelaxNG validation
         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


And even more!



     Bulk loader for XML data (parallelize the XML parsing)
     XML-awareness in APIs and PLs
     Additional contribs/projects (web services, ODF, DocBook
     utils, etc)
     New tools and applications, integration with existing ones




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                      Current Developments
                       Future Developments
                                Use Cases
                                Conclusion


Use Cases




    Use Case 1: Document Management System
    Use Case 2: Store Logs in the Database
    Use Case 3: Heterogeneous Catalog




       Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 1: Document Management System




  The primary goal: to store documents in the RDBMS as is




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 2: Store Logs in the Database


                                      Table: action

                        action_id                          SERIAL
                        action_type_id                     INT4
                        action_status_id                   INT4
                        action_person_id                   INT4
                        action_data                        XML


  The primary goal: to achieve flexibility, avoid DB schema
  changes (schema evolution)

          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 3: Heterogeneous Catalog



  Task: to build heterogeneous catalog (items of different types, a
  lot of properties)




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 3: Heterogeneous Catalog



  Task: to build heterogeneous catalog (items of different types, a
  lot of properties)



                                            How?




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                        Current Developments
                         Future Developments
                                  Use Cases
                                  Conclusion


Use Case 3: Heterogeneous Catalog
  Ugly way




         Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 3: Heterogeneous Catalog


  Entity-Attribute-Value model




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Use Case 3: Heterogeneous Catalog


  Semi-structured data approach




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                          Current Developments
                           Future Developments
                                    Use Cases
                                    Conclusion


Use Case 3: Heterogeneous Catalog
  Metadata Query Interface for Heterogeneous Data Archives
  (International Virtual Observatory): http://alcor.sao.ru/php/search/




           Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


Outline


  1   Past Developments

  2   Current Developments

  3   Future Developments

  4   Use Cases

  5   Conclusion



          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type
Past Developments
                         Current Developments
                          Future Developments
                                   Use Cases
                                   Conclusion


More Information


     SQL:2006, Part 14: XML-Related Specifications.
     http://wiscorp.com/sql200n.zip

     PostgreSQL documentation.
     http://momjian.us/main/writings/pgsql/sgml/

     XML Development Wiki Page.
     http://developer.postgresql.org/index.php/XML_Support

     N. Samokhvalov. XML Support in PostgreSQL. In
     Proceedings of SYRCoDIS. Moscow, Russia, 2007.
     http://samokhvalov.com/syrcodis2007.ps




          Nikolay Samokhvalov, Peter Eisentraut   The Road to the XML Type

Mais conteúdo relacionado

Semelhante a The Road to the XML Type: Past Developments, Current Features, and Future Plans

Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007
Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007
Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007Nikolay Samokhvalov
 
ibm_research_aug_8_03
ibm_research_aug_8_03ibm_research_aug_8_03
ibm_research_aug_8_03Attila Barta
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for DatabindingPaul Downey
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and DevelopmentPeter Eisentraut
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Dr.-Ing. Thomas Hartmann
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your TemplatesThomas Weinert
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamudAsfak Mahamud
 
LINQ to XML
LINQ to XMLLINQ to XML
LINQ to XMLukdpe
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new featuresJakub Malý
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
ODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XMLODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XMLMarco Gralike
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentationthinkphp
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsCardinaleWay Mazda
 
XML Prague 2005 EXSLT
XML Prague 2005 EXSLTXML Prague 2005 EXSLT
XML Prague 2005 EXSLTjimfuller2009
 
ACS 248th Paper 136 JSmol/JSpecView Eureka Integration
ACS 248th Paper 136 JSmol/JSpecView Eureka IntegrationACS 248th Paper 136 JSmol/JSpecView Eureka Integration
ACS 248th Paper 136 JSmol/JSpecView Eureka IntegrationStuart Chalk
 

Semelhante a The Road to the XML Type: Past Developments, Current Features, and Future Plans (20)

PostgreSQL and XML
PostgreSQL and XMLPostgreSQL and XML
PostgreSQL and XML
 
Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007
Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007
Postgresql N Samokhvalov P Eisentraut Xml Type Pgcon Ottawa 2007
 
PGCon-2007 The Road to XML Type
PGCon-2007 The Road to XML TypePGCon-2007 The Road to XML Type
PGCon-2007 The Road to XML Type
 
ibm_research_aug_8_03
ibm_research_aug_8_03ibm_research_aug_8_03
ibm_research_aug_8_03
 
XML Schema Patterns for Databinding
XML Schema Patterns for DatabindingXML Schema Patterns for Databinding
XML Schema Patterns for Databinding
 
XML Support: Specifications and Development
XML Support: Specifications and DevelopmentXML Support: Specifications and Development
XML Support: Specifications and Development
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
Workshop on Semantic Statistics - Generic Multilevel Approach Designing Domai...
 
The Lumber Mill Xslt For Your Templates
The Lumber Mill   Xslt For Your TemplatesThe Lumber Mill   Xslt For Your Templates
The Lumber Mill Xslt For Your Templates
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
LINQ to XML
LINQ to XMLLINQ to XML
LINQ to XML
 
XSLT 3.0 - new features
XSLT 3.0 - new featuresXSLT 3.0 - new features
XSLT 3.0 - new features
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
ODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XMLODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XML
 
Ajax Introduction Presentation
Ajax   Introduction   PresentationAjax   Introduction   Presentation
Ajax Introduction Presentation
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
What is new in Axis2 1.7.0
What is new in Axis2 1.7.0 What is new in Axis2 1.7.0
What is new in Axis2 1.7.0
 
XML Prague 2005 EXSLT
XML Prague 2005 EXSLTXML Prague 2005 EXSLT
XML Prague 2005 EXSLT
 
ACS 248th Paper 136 JSmol/JSpecView Eureka Integration
ACS 248th Paper 136 JSmol/JSpecView Eureka IntegrationACS 248th Paper 136 JSmol/JSpecView Eureka Integration
ACS 248th Paper 136 JSmol/JSpecView Eureka Integration
 

Mais de Nikolay Samokhvalov

Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...
 Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва... Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...
Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...Nikolay Samokhvalov
 
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данных
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данныхПромышленный подход к тюнингу PostgreSQL: эксперименты над базами данных
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данныхNikolay Samokhvalov
 
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San Jose
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San JoseThe Art of Database Experiments – PostgresConf Silicon Valley 2018 / San Jose
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San JoseNikolay Samokhvalov
 
Nancy CLI. Automated Database Experiments
Nancy CLI. Automated Database ExperimentsNancy CLI. Automated Database Experiments
Nancy CLI. Automated Database ExperimentsNikolay Samokhvalov
 
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросыNikolay Samokhvalov
 
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросыNikolay Samokhvalov
 
Database First! О распространённых ошибках использования РСУБД
Database First! О распространённых ошибках использования РСУБДDatabase First! О распространённых ошибках использования РСУБД
Database First! О распространённых ошибках использования РСУБДNikolay Samokhvalov
 
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6Nikolay Samokhvalov
 
#noBackend, или Как выжить в эпоху толстеющих клиентов
#noBackend, или Как выжить в эпоху толстеющих клиентов#noBackend, или Как выжить в эпоху толстеющих клиентов
#noBackend, или Как выжить в эпоху толстеющих клиентовNikolay Samokhvalov
 
#PostgreSQLRussia в банке Тинькофф, доклад №1
#PostgreSQLRussia в банке Тинькофф, доклад №1#PostgreSQLRussia в банке Тинькофф, доклад №1
#PostgreSQLRussia в банке Тинькофф, доклад №1Nikolay Samokhvalov
 
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"Nikolay Samokhvalov
 
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...Nikolay Samokhvalov
 
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...Nikolay Samokhvalov
 
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...Nikolay Samokhvalov
 
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...Nikolay Samokhvalov
 
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.42014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4Nikolay Samokhvalov
 
2014.12.23 Александр Андреев, Parallels
2014.12.23 Александр Андреев, Parallels2014.12.23 Александр Андреев, Parallels
2014.12.23 Александр Андреев, ParallelsNikolay Samokhvalov
 
2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ruNikolay Samokhvalov
 
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussiaNikolay Samokhvalov
 

Mais de Nikolay Samokhvalov (20)

Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...
 Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва... Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...
Эксперименты с Postgres в Docker и облаках — оптимизация настроек и схемы ва...
 
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данных
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данныхПромышленный подход к тюнингу PostgreSQL: эксперименты над базами данных
Промышленный подход к тюнингу PostgreSQL: эксперименты над базами данных
 
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San Jose
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San JoseThe Art of Database Experiments – PostgresConf Silicon Valley 2018 / San Jose
The Art of Database Experiments – PostgresConf Silicon Valley 2018 / San Jose
 
Nancy CLI. Automated Database Experiments
Nancy CLI. Automated Database ExperimentsNancy CLI. Automated Database Experiments
Nancy CLI. Automated Database Experiments
 
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
 
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы#RuPostgresLive 4: как писать и читать сложные SQL-запросы
#RuPostgresLive 4: как писать и читать сложные SQL-запросы
 
Database First! О распространённых ошибках использования РСУБД
Database First! О распространённых ошибках использования РСУБДDatabase First! О распространённых ошибках использования РСУБД
Database First! О распространённых ошибках использования РСУБД
 
2016.10.13 PostgreSQL in Russia
2016.10.13 PostgreSQL in Russia2016.10.13 PostgreSQL in Russia
2016.10.13 PostgreSQL in Russia
 
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6
#RuPostges в Yandex, эпизод 3. Что же нового в PostgreSQL 9.6
 
#noBackend, или Как выжить в эпоху толстеющих клиентов
#noBackend, или Как выжить в эпоху толстеющих клиентов#noBackend, или Как выжить в эпоху толстеющих клиентов
#noBackend, или Как выжить в эпоху толстеющих клиентов
 
#PostgreSQLRussia в банке Тинькофф, доклад №1
#PostgreSQLRussia в банке Тинькофф, доклад №1#PostgreSQLRussia в банке Тинькофф, доклад №1
#PostgreSQLRussia в банке Тинькофф, доклад №1
 
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"
SFPUG 2015.11.20 lightning talk "PostgreSQL in Russia"
 
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...
Владимир Бородин: Как спать спокойно - 2015.10.14 PostgreSQLRussia.org meetu...
 
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...
#PostgreSQLRussia 2015.09.15 - Николай Самохвалов - 5 главных особенностей Po...
 
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...
#PostgreSQLRussia 2015.09.15 - Максим Трегубов, CUSTIS - Миграция из Oracle в...
 
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...
Три вызова реляционным СУБД и новый PostgreSQL - #PostgreSQLRussia семинар по...
 
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.42014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4
2014.12.23 Николай Самохвалов, Ещё раз о JSON(b) в PostgreSQL 9.4
 
2014.12.23 Александр Андреев, Parallels
2014.12.23 Александр Андреев, Parallels2014.12.23 Александр Андреев, Parallels
2014.12.23 Александр Андреев, Parallels
 
2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru2014.10.15 Сергей Бурладян, Avito.ru
2014.10.15 Сергей Бурладян, Avito.ru
 
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia
2014.10.15 Мурат Кабилов, Avito.ru #PostgreSQLRussia
 

Último

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

The Road to the XML Type: Past Developments, Current Features, and Future Plans

  • 1. The Road to the XML Type Current and Future Developments Nikolay Samokhvalov Peter Eisentraut PGCon 2007
  • 2. Past Developments Current Developments Future Developments Use Cases Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 3. Past Developments Current Developments Future Developments Use Cases Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 4. Past Developments Current Developments Future Developments Use Cases Conclusion Past Developments contrib/xml2 by J. Gray et al. Initial patch for SQL/XML publishing functions by Pavel Stehule Google Summer of Code 2006 - Nikolay Samokhvalov Initial version of export functions by Peter Eisentraut Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 5. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 6. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion New Features Target for PostgreSQL 8.3: XML Data Type XML Publishing XML Export SQL:2003 conformance XPath Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 7. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Outline 1 Past Developments 2 Current Developments XML Data Type XML Publishing XML Export XPath 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 8. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Data Type CREATE TABLE test ( ..., data xml, ... ); Features: Input checking Support functions Issues: Internal storage format (plain text) Encoding handling Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 9. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Using the XML Type Bizarre SQL way: INSERT INTO test VALUES ( ..., XMLPARSE (DOCUMENT ’<foo>...</foo>’), ... ); SELECT XMLSERIALIZE (DOCUMENT data AS varchar) FROM test; Simple PostgreSQL way: INSERT INTO test VALUES (... , ’<foo>...</foo>’, ...); SELECT data FROM test; Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 10. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Type Oddities No comparison operators To retrieve, use: Cast to text, or XPath, or Other key column To index, use: Cast to text, or XPath Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 11. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Outline 1 Past Developments 2 Current Developments XML Data Type XML Publishing XML Export XPath 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 12. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Producing XML Content The old way? SELECT ’<record id=quot;’ || id || ’quot;><value>’ || ad_hoc_escape_func(value) || ’</value></record>’ FROM tab; The new way: SELECT XMLELEMENT(NAME record, XMLATTRIBUTES(id), XMLELEMENT(NAME value, value)) FROM tab; Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 13. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XMLELEMENT Example SQL: Result: XMLROOT ( <?xml version=’1.0’ XMLELEMENT ( standalone=’yes’ ?> NAME ’gazonk’, <gazonk name=’val’ XMLATTRIBUTES ( num=’2’> ’val’ AS ’name’, <qux>foo</qux> 1 + 1 AS ’num’ </gazonk> ), XMLELEMENT ( NAME ’qux’, ’foo’ ) ), VERSION ’1.0’, STANDALONE YES ) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 14. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XMLFOREST Example SELECT xmlforest ( quot;FirstNamequot; as quot;FNamequot;, quot;LastNamequot; as quot;LNamequot;, ’string’ as quot;strquot;, quot;Titlequot;, quot;Regionquot; ) FROM quot;Demoquot;.quot;demoquot;.quot;Employeesquot;; might result in <FName>Nancy</FName> <LName>Davolio</LName> <str>string</str> <Title>Sales Representative</Title> <Region>WA</Region> . . . <FName>Anne</FName> <LName>Dodsworth</LName> <str>string</str> <Title>Sales Representative</Title> (1 row per record) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 15. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XMLAGG Example SELECT xmlelement (’Emp’, xmlattributes (’Sales Representative’ as quot;Titlequot;), xmlagg (xmlelement (’Name’, quot;FirstNamequot;, ’ ’, quot;LastNamequot;))) FROM quot;Demoquot;.quot;demoquot;.quot;Employeesquot; WHERE quot;Titlequot; = ’Sales Representative’; might result in <Emp Title=quot;Sales Representativequot;> <Name>Nancy Davolio</Name> <Name>Janet Leverling</Name> <Name>Margaret Peacock</Name> <Name>Michael Suyama</Name> <Name>Robert King</Name> <Name>Anne Dodsworth</Name> </Emp> (1 row) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 16. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Outline 1 Past Developments 2 Current Developments XML Data Type XML Publishing XML Export XPath 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 17. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Export Map table/schema/database contents to XML document Map table/schema/database schema to XML Schema Useful for: Downstream processing (e.g., SOAP, web services) Postprocessing using XSLT Backup??? Display formats (alternative to psql’s HTML mode) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 18. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Export Functions Data export: table_to_xml(tbl regclass, nulls boolean, tableforest boolean, targetns text) query_to_xml(query text, nulls boolean, tableforest boolean, targetns text) cursor_to_xml(cursor refcursor, count int, nulls boolean, tableforest boolean, targetns text) Schema export: table_to_xmlschema(tbl regclass, nulls boolean, tableforest boolean, targetns text) query_to_xmlschema(query text, nulls boolean, tableforest boolean, targetns text) cursor_to_xmlschema(cursor refcursor, nulls boolean, tableforest boolean, targetns text) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 19. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Schema Mapping Example CREATE TABLE test (a int PRIMARY KEY, b varchar(200)); is mapped to <xsd:complexType name=quot;RowType.catalog.schema.testquot;> <xsd:sequence> <xsd:element name=quot;aquot; type=quot;INTEGERquot;></xsd:element> <xsd:element name=quot;bquot; type=quot;VARCHAR_200_200quot; minOccurs=quot;0quot;></xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name=quot;TableType.catalog.schema.testquot;> <xsd:sequence> <xsd:element name=quot;rowquot; type=quot;RowType.catalog.schema.testquot; minOccurs=quot;0quot; maxOccurs=quot;unboundedquot; /> </xsd:sequence> </xsd:complexType> Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 20. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XML Export Format Example <catalogname> <schemaname> <tablename> <row> <colname1>value</colname1> <colname2 xsi:nil=’true’/> ... </row> ... </tablename> ... </schemaname> ... </catalogname> Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 21. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion Outline 1 Past Developments 2 Current Developments XML Data Type XML Publishing XML Export XPath 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 22. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XPath example The table for further examples: CREATE TABLE table1( id INTEGER PRIMARY KEY, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, xdata XML ); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 23. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XPath Example Sample data: INSERT INTO table1(id, xdata) VALUES( 1, ’<dept xmlns:smpl=quot;http://example.comquot; smpl:did=quot;DPT011-ITquot;> <name>IT</name> <persons> <person smpl:pid=quot;111quot;> <name>John Smith</name> <age>24</age> </person> <person smpl:pid=quot;112quot;> <name>Michael Black</name> <age>28</age> </person> </persons> </dept>’ ); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 24. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XPath Example Simple example: SELECT * FROM table1 WHERE (xpath(’//person/name/text()’, xdata))[1]::text = ’John Smith’; And using namespaces: xmltest=# SELECT * FROM table1 WHERE (xpath(’//person/@smpl:pid’, xdata, ARRAY[ARRAY[’smpl’, ’http://example.com’]]))::text = ’111’ FROM table1; Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 25. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion XPath: Indexes Use functional indexes to avoid XPath evaluation at runtime: CREATE INDEX i_table1_xdata ON table1 USING btree( xpath(’//person/@name’, xdata) ); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 26. Past Developments XML Data Type Current Developments XML Publishing Future Developments XML Export Use Cases XPath Conclusion External Dependencies Uses libxml (MIT License) for XML publishing and XPath Enable with configure --with-libxml Not necessary for XML export Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 27. Past Developments Current Developments Future Developments Use Cases Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 28. Past Developments Current Developments Future Developments Use Cases Conclusion Future Developments DTD and XML Schema validation Annotated schema decomposition XSLT Performance issues Full-Text Search Advanced Indexing (XLABEL) More, More, More Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 29. Past Developments Current Developments Future Developments Use Cases Conclusion DTD and XML Schema validation DTD validation: Implemented for 8.3, DTD is passed by URI Should be extended to allow passing DTD as text XML Schema (XSD) validation (XMLVALIDATE per SQL:2006): INSERT INTO messages(msg) SELECT xmlvalidate( DOCUMENT ’<?xml ...’ ACCORDING TO XMLSCHEMA NO NAMESPACE LOCATION ’http://mycompany.com/msg-schema’ ); The result of XMLVALIDATE is new XML value! Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 30. Past Developments Current Developments Future Developments Use Cases Conclusion Annotated schema decomposition In some cases decomposition is better (no needs in storing XML data, XML serves as transport only): When we need to store only small parts of the XML data Already developed tools might be designed only for relational data During decomposition following capabilities could be used: Data normalization Foreign keys creation Conditional insertion of data chunks Insert parts of initial XML document as XML values Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 31. Past Developments Current Developments Future Developments Use Cases Conclusion XSLT The easiest way: adapt and expand contrib/xml2’s capabilities. We should choose one of two: Move XSLT functionality to the core (and use --with-libxslt) Separate contrib/xslt Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 32. Past Developments Current Developments Future Developments Use Cases Conclusion Performance issues Ideas: Cache intermediate results to avoid redundant parsing and XPath evaluation Advanced physical storage to speedup access to arbitrary node in XML data Use PostgreSQL existing capabilities for full-text search Use additional structures/tables/indexes to avoid XPath evaluation at runtime Use slices (similar to array_extract_slice()) to avoid dealing with entire values (both in SELECTs and UPDATEs) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 33. Past Developments Current Developments Future Developments Use Cases Conclusion Full-Text Search Simple way to create FTS index (available in 8.3): CREATE INDEX i_table1_fts ON table1 USING gist( to_tsvector( ’default’, array_to_string(xpath(’//text()’, xdata), ’ ’) ) ); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 34. Past Developments Current Developments Future Developments Use Cases Conclusion Full-Text Search Proposal for overloading of built-in to_tsvector(): CREATE OR REPLACE FUNCTION to_tsvector(text, xml) RETURNS tsearch2.tsvector AS $BODY$ SELECT to_tsvector( $1, array_to_string(xpath(’//text()’, $2), ’ ’) ); $BODY$ LANGUAGE sql IMMUTABLE; CREATE INDEX i_table1_fts ON table1 USING gist(to_tsvector(’default’, xdata)); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 35. Past Developments Current Developments Future Developments Use Cases Conclusion Full-Text Search Further ideas for full-text search: Indexing parts of documents (available in 8.3, in some way) Element names in tsvector Relevance Scoring (ranking) FTS parser for XML Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 36. Past Developments Current Developments Future Developments Use Cases Conclusion XLABEL Idea: Enumerate all XML node names in one database-wide table (xnames) Store shredded data in additional table (columnname_xlabel) Use numbering scheme (in prototype it’s ltree, then SLS) encode nodes Use GiST/GIN indexes for numbering scheme column Rewrite XPath expression to plain SQL statement Implement partial updates support to avoid massive index rebuilding Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 37. Past Developments Current Developments Future Developments Use Cases Conclusion XLABEL Enumerate all XML node names in the database: Table: xnames xname_id xname_name 1 person 2 dept 3 name 4 did 5 persons ... ... Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 38. Past Developments Current Developments Future Developments Use Cases Conclusion XLABEL For an XML column implicitly create additional table (using xlabel.register_column() function): Table: table1_xdata tid xlabel node_type xname_id value 1 a 1 (elem.) 2 NULL 1 a.b 2 (attr.) 4 DPT011-IT 1 a.c 1 (elem.) 3 NULL 1 a.c.a NULL NULL IT ... ... ... ... ... 1 a.d.a.b 1 (elem.) 3 NULL 1 a.d.a.b.a NULL NULL John Smith ... ... ... ... ... CREATE INDEX i_table1_xdata_xlabel ON table1_xdata USING gist(xlabel); Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 39. Past Developments Current Developments Future Developments Use Cases Conclusion XLABEL Rewrite XPath expression to plain SQL statement: SELECT * FROM table1 WHERE array_dims(xpath(’//person/name’, xdata)) IS NOT NULL; ... becomes ... SELECT * FROM table1 WHERE EXISTS( SELECT 1 FROM table1_xdata AS t1, table1_xdata AS t2 WHERE t1.xname_id = 1 AND t2.xname_id = 3 AND t3.xlabel <@ t1.xlabel ); ... where <@ means “is a child of” Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 40. Past Developments Current Developments Future Developments Use Cases Conclusion XLABEL Current thoughts: Separate table is not good (deja vu: fti VS tsearch2) It would be great if one structure solves 2 problems at once: access to arbitrary node SELECTs with XPath Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 41. Past Developments Current Developments Future Developments Use Cases Conclusion More, more, more Inline ORDER BY for XMLAGG (SQL:2003) ... XMLAGG(XMLELEMENT(...) ORDER BY col1) ... XMLCAST (SQL:2006) XML Canonical Pretty-printing XML Registered XML Schemas (SQL:2006) Schema evolution Improve Data Model (XDM) XQuery Support (SQL:2006) Updatable XML views (over relational data) RelaxNG validation Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 42. Past Developments Current Developments Future Developments Use Cases Conclusion And even more! Bulk loader for XML data (parallelize the XML parsing) XML-awareness in APIs and PLs Additional contribs/projects (web services, ODF, DocBook utils, etc) New tools and applications, integration with existing ones Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 43. Past Developments Current Developments Future Developments Use Cases Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 44. Past Developments Current Developments Future Developments Use Cases Conclusion Use Cases Use Case 1: Document Management System Use Case 2: Store Logs in the Database Use Case 3: Heterogeneous Catalog Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 45. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 1: Document Management System The primary goal: to store documents in the RDBMS as is Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 46. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 2: Store Logs in the Database Table: action action_id SERIAL action_type_id INT4 action_status_id INT4 action_person_id INT4 action_data XML The primary goal: to achieve flexibility, avoid DB schema changes (schema evolution) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 47. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Task: to build heterogeneous catalog (items of different types, a lot of properties) Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 48. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Task: to build heterogeneous catalog (items of different types, a lot of properties) How? Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 49. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Ugly way Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 50. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Entity-Attribute-Value model Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 51. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Semi-structured data approach Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 52. Past Developments Current Developments Future Developments Use Cases Conclusion Use Case 3: Heterogeneous Catalog Metadata Query Interface for Heterogeneous Data Archives (International Virtual Observatory): http://alcor.sao.ru/php/search/ Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 53. Past Developments Current Developments Future Developments Use Cases Conclusion Outline 1 Past Developments 2 Current Developments 3 Future Developments 4 Use Cases 5 Conclusion Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type
  • 54. Past Developments Current Developments Future Developments Use Cases Conclusion More Information SQL:2006, Part 14: XML-Related Specifications. http://wiscorp.com/sql200n.zip PostgreSQL documentation. http://momjian.us/main/writings/pgsql/sgml/ XML Development Wiki Page. http://developer.postgresql.org/index.php/XML_Support N. Samokhvalov. XML Support in PostgreSQL. In Proceedings of SYRCoDIS. Moscow, Russia, 2007. http://samokhvalov.com/syrcodis2007.ps Nikolay Samokhvalov, Peter Eisentraut The Road to the XML Type