BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0 - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
Date
Msg-id 16277-efdbe9891408668e@postgresql.org
Whole thread Raw
Responses Re: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16277
Logged by:          Andreas Lennartsson
Email address:      andreas@apkudo.com
PostgreSQL version: 10.7
Operating system:   Ubuntu
Description:

The following example:
SELECT
  xmlroot (
     xmlelement (name "test", CHR(26))
  , version '1.0'
  )

Produces xml with the invalid ASCII character 26.

The documentation states:
Element content, if specified, will be formatted according to its data type.
If the content is itself of type xml, complex XML documents can be
constructed.
Content of other types will be formatted into valid XML character data. This
means in particular that the characters <, >, and & will be converted to
entities. Binary data (data type bytea) will be represented in base64 or hex
encoding, depending on the setting of the configuration parameter xmlbinary.
The particular behavior for individual data types is expected to evolve in
order to align the SQL and PostgreSQL data types with the XML Schema
specification, at which point a more precise description will appear.


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16276: Server crash on an invalid attempt to attach a partition to an index
Next
From: Tom Lane
Date:
Subject: Re: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0