Re: Does XMLSERIALIZE output xmlattributes in a stable order? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Does XMLSERIALIZE output xmlattributes in a stable order?
Date
Msg-id 6928.1511282951@sss.pgh.pa.us
Whole thread Raw
In response to Does XMLSERIALIZE output xmlattributes in a stable order?  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: Does XMLSERIALIZE output xmlattributes in a stable order?  (Chapman Flack <chap@anastigmatix.net>)
List pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> Suppose I have a query that generates some XML content, and I want
> to do this on a periodic schedule and check the resulting XML into
> a version control system.
> ...
> But then, there are the attributes of elements. Order of attributes
> is not significant in XML, and is not required (by the "XML Infoset"
> standard) to be preserved. Nevertheless, it would be a useful
> property (for a purpose like I've described) if XMLSERIALIZE were
> known to at least produce the attributes in some consistent order
> across evaluations of the same query.

> Is that true of the implementation in PostgreSQL? I might find out
> with a quick test, but it seemed worth explicitly asking.

AFAICS, XMLSERIALIZE in our current implementation boils down to
being a binary-compatible coercion from XML (which is stored as
a string) to text.  So the interesting question here is where are
you getting the XML values from?  The stability of the results is
going to be whatever the next level down does.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Inlining functions with "expensive" parameters
Next
From: Tom Lane
Date:
Subject: Re: View with duplicate GROUP BY entries