Log In - Home Page

Patch: Bugfix for XPATH() if text or attribute nodes are selected

Edit Patch - Move To Another CommitFest - Delete Patch

CommitFest 2011-06
Topic SQL Features
Patch Status Committed
Author Florian Pflug
Reviewers Radosław Smogura
Committer Tom Lane
Close Date 2011-07-21
Comments
Patch by fgp on 2011-06-09 06:01:34 PM: Initial version.
Comment by fgp on 2011-06-09 06:02:24 PM: Without the patch SELECT (XPATH('/*/text()', '<root>&lt;</root>'))[1] returns '<' which isn't valid XML.
Comment by fgp on 2011-06-17 09:48:19 AM: Radosław Smogura found two other issues with XPATH, but in both cases the returned XML is at least well-formed.
Review by fgp on 2011-06-29 10:11:12 PM: Radoslaw believes that the current behaviour is per design, even though it creates instances of type XML which are not well-formed.
Review by rsmogura on 2011-07-14 05:48:03 PM: Peter Eisentraut is up for this so I bump it up. My objections was:
- possibility of double escaping
- problems with de-escaping this on client side
- this patch doens't resolves all mentioned problems about inserting wrong XMLs, if we are going in this mentioned spirit the result of text node must not only be escaped, but wrapped by any kind of root element
- backward compatibility problems
- if user recreates XML which is serialized as text in some node, after patch he will insert improper XMLs, because he will get escaped text - no root element.
- when I ask for text() I want to extract text not a XML, if I want to get node I will ask /* not a text(/*)
Comment by aglio on 2011-07-14 07:14:32 PM: Ready to go, per Radoslaw.

Add Comment

Please log in to comment on this patch.