Re: SQL/XML publishing function experimental patch II - Mailing list pgsql-patches

From Nikolay Samokhvalov
Subject Re: SQL/XML publishing function experimental patch II
Date
Msg-id e431ff4c0608230212t459b052du40f3f3e34c21427d@mail.gmail.com
Whole thread Raw
In response to Re: SQL/XML publishing function experimental patch  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
On 8/22/06, Bruce Momjian <bruce@momjian.us> wrote:
>
> I am still waiting for some documentation on what XML support we have,
> and what we need.  We can't decide on this patch until we have that.
>

Here is my thoughts:
http://nikolay.samokhvalov.com/2006/08/23/xml-and-relational/
(maybe too much words - sorry for it - but classification is very
simple and then I give some simple but important examples; if you them
too boring, read the two comments and the end).

As for that patch itself, I can say two things:
  1. It's really useful but can be considered only as the first step
to XML type support; I personally would be very happy if it will be
included in 8.2 not by default, but with "--with-xml" configure option
(the patch changes the grammar... is it possible to provide the user
with capabilities to define during configuration process what parts of
gram.y will be turned on?)
 2. It has some problems such as following:
    a) "SELECT XMLELEMENT(NAME "A<!--111", 222);" produces invalid XML
(the substring "--" cannot be used in element names, and even as text
value of XML elements). In other words, patch uses ColCabel to define
XML element names, which is not correct (needs additional narrowing);
    b) subqueries inside some constructions are not possible, e.g.:
"SELECT XMLCONCAT((SELECT XMLELEMENT(NAME aaa, 111)), XMLELEMENT(NAME
bbb, 222));" doesn't work (only straight list of xmlexpr can be
accepted). Another simple example of this issue is XMLCONCAT of NULLs
(NULL is valid XML value according to SQL/XML:200{3,6});
    c) XMLPI should have "NAME" keyword before the first argument
(similar to XMLELEMENT), according to SQL/XML:2003.

Since I use this patch in my work on SoC's "initial support of XML
type" (I'll describe results and provide the code in the separate
messages later), I've improved some of issues as long as typos - such
as "<-- ... -->" instead of "<!-- ... -->" in XMLCOMMENT definition,
code style cleanup, etc. If you decide to include Pavel's patch to
8.2, I'll be glad to create the slightly improved version of his
patch.

I plan to continue discussing the theme of XML-enabled databases and
discuss abilities that Postgres has in this area.

Hope, this will help. Please, if you see that I am wrong somewhere -
let me know / let's discuss it.

--
Best regards,
Nikolay

pgsql-patches by date:

Previous
From: Karel Zak
Date:
Subject: Re: [HACKERS] COPY view
Next
From: Karel Zak
Date:
Subject: Leaving... (was: Re: [HACKERS] COPY view)