PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16277
PG Version10.7
OSUbuntu
Opened2020-02-25 18:58:57+00
Reported byAndreas Lennartsson
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16277
Logged by:          Andreas Lennartsson
Email address:      (redacted)
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.

Messages

DateAuthorSubject
2020-02-25 18:58:57+00PG Bug reporting formBUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
2020-02-25 19:59:53+00Tom LaneRe: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
2020-02-25 21:14:13+00Andreas LennartssonRe: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
2020-02-25 22:00:14+00Tom LaneRe: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
2020-02-26 18:44:50+00Andreas LennartssonRe: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0