Re: PostgreSQL vs SQL/XML Standards

Поиск
Список
Период
Сортировка
Искать
От
Markus Winand
Тема
Re: PostgreSQL vs SQL/XML Standards
Дата
Msg-id
FB592C2F-E2F3-42FD-A342-EE41BECD3771@winand.at
Ответ на
Список
Дерево обсуждения
PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Tom Lane <tgl@sss.pgh.pa.us>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Markus Winand <markus.winand@winand.at>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Markus Winand <markus.winand@winand.at>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
doc: where best to add ~ 400 words to the manual? Chapman Flack <chap@anastigmatix.net>
Re: doc: where best to add ~ 400 words to the manual? Chapman Flack <chap@anastigmatix.net>
Re: doc: where best to add ~ 400 words to the manual? Chapman Flack <chap@anastigmatix.net>
House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: House style for DocBook documentation? "Joshua D. Drake" <jd@commandprompt.com>
Re: House style for DocBook documentation? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? "Joshua D. Drake" <jd@commandprompt.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? "Joshua D. Drake" <jd@commandprompt.com>
Re: House style for DocBook documentation? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: House style for DocBook documentation? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: House style for DocBook documentation? Chapman Flack <chap@anastigmatix.net>
Re: House style for DocBook documentation? Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: House style for DocBook documentation? Ramanarayana <raam.soft@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Ramanarayana <raam.soft@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Michael Paquier <michael@paquier.xyz>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: Re: PostgreSQL vs SQL/XML Standards David Steele <david@pgmasters.net>
Re: PostgreSQL vs SQL/XML Standards Arthur Zakirov <a.zakirov@postgrespro.ru>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Pavel Stehule <pavel.stehule@gmail.com>
Re: PostgreSQL vs SQL/XML Standards Thomas Kellerer <spam_eater@gmx.net>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Andreas Karlsson <andreas@proxel.se>
Re: PostgreSQL vs SQL/XML Standards Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Jesper Pedersen <jesper.pedersen@redhat.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>
Re: PostgreSQL vs SQL/XML Standards Alvaro Herrera <alvherre@2ndquadrant.com>
Re: PostgreSQL vs SQL/XML Standards Chapman Flack <chap@anastigmatix.net>

> On 2018-11-6, at 15:23 , Pavel Stehule  wrote:
> 
> 
> 
> po 29. 10. 2018 v 11:45 odesílatel Pavel Stehule  napsal:
> 
> 
> po 29. 10. 2018 v 10:11 odesílatel Pavel Stehule  napsal:
> Hi
> 
> čt 25. 10. 2018 v 21:47 odesílatel Alvaro Herrera  napsal:
> On 2018-Oct-25, Pavel Stehule wrote:
> 
> > I am thinking so I can fix some issues related to XMLTABLE. Please, send me
> > more examples and test cases.
> 
> Please see Markus Winand's patch that I referenced upthread.
> 
> here is a fix of some XMLTABLE mentioned issues.
> 
> this update allows cast boolean to numeric types from XPath expressions
> 
> Attached patch solves some cast issues mentioned by Chap. It solves issue reported by Markus. I didn't use Markus's code, but it was inspiration for me. I found native solution from libxml2.
> 
> Regards
> 
> Pavel

Better than my patch.

But I think the chunk in xml_xmlnodetoxmltype of my patch is still needed — in one way or the other (see below).

# select * from xmltable('*' PASSING 'pre&deeppost' COLUMNS x XML PATH 'node()');
                    x
-----------------------------------------
 prec1arg&ent1&deeppost
(1 row)

Output is not the original XML.

I dug a little further and found another case that doesn’t looks right even with my change to xml_xmlnodetoxmltype applied:

# select * from xmltable('*' PASSING 'pre&deeppost' COLUMNS x XML PATH '/');
             x
---------------------------
 pre&ent1&deeppost
(1 row)

Oracle gives in both cases XML.

To fix that I included XML_DOCUMENT_NODE in the list of nodes that use xmlNodeDump. Now I wonder if that logic should be reversed to use the xmlXPathCastNodeToString branch in a few selected cases but default to the branch xmlNodeDump for all other cases?

I guess those few cases might be XML_ATTRIBUTE_NODE and XML_TEXT_NODE. Regression tests are happy with that approach but I don’t think that proves a lot.

-markus

diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 37d85f7..7c1f884 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -3682,7 +3682,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur, PgXmlErrorContext *xmlerrcxt)
 {
        xmltype    *result;

-       if (cur->type == XML_ELEMENT_NODE)
+       if (cur->type != XML_ATTRIBUTE_NODE && cur->type != XML_TEXT_NODE)
        {
                xmlBufferPtr buf;
                xmlNodePtr      cur_copy;



В списке pgsql-hackers по дате отправления
От: Antonin Houska
Дата:
От: Konstantin Knizhnik
Дата:
FAQ