BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: andreas(at)apkudo(dot)com
Subject: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
Date: 2020-02-25 18:58:57
Message-ID: 16277-efdbe9891408668e@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-02-25 19:59:53 Re: BUG #16277: xmlelement allows invalid XML characters when XML version is set to 1.0
Previous Message PG Bug reporting form 2020-02-25 16:00:01 BUG #16276: Server crash on an invalid attempt to attach a partition to an index