BenSatori opened a new pull request, #2507:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2507
Adds support for PostgreSQL XML function syntaxes:
- `XMLELEMENT(NAME name [, XMLATTRIBUTES(...) ] [, content [, ...]])`
- `XMLPI(NAME name [, content ])`
- `XMLROOT(xml, VERSION {text | NO VALUE} [, STANDALONE {YES | NO | NO
VALUE} ])`
- `XMLSERIALIZE({ DOCUMENT | CONTENT } value AS type [ [ NO ] INDENT ])`
- `XMLEXISTS(text PASSING [BY {REF|VALUE}] xml [BY {REF|VALUE}])`
### Example
```sql
SELECT XMLELEMENT(NAME foo, 'bar'), * FROM customers;
SELECT XMLELEMENT(NAME foo, XMLATTRIBUTES('v' AS attr), 'bar');
SELECT XMLROOT('<a/>'::xml, VERSION '1.0');
SELECT XMLSERIALIZE(DOCUMENT '<a/>'::xml AS TEXT);
SELECT XMLEXISTS('/a' PASSING BY REF '<a/>');
```
Docs:
- https://www.postgresql.org/docs/current/functions-xml.html
- https://www.postgresql.org/docs/current/datatype-xml.html
*AI Assistance: Code authored and validated with GitHub Copilot.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]