Assume Table A with an XML field. Table A has two rows, with the following XML data in the table.
Row 1
<fullname>
<firstName>John</firstName>
<lastName>Smith</lastName>
</fullname>
and Row 2
<fullname>
<firstName>Jane</firstName>
</fullname>
This query:
SELECT * FROM A
XMLTABLE(('/fullname'::text) PASSING (a.xml)
COLUMNS firstName text PATH ('firstName'::text), lastName text PATH ('lastName'::text)) a
will only return data on John and not Jane. Is there a work around for this?
https://www.postgresql.org/docs/13/functions-xml.html
"default X" resolved the issue.