XML element with special characters can be created, serialized, but not deserialized

Поиск
Список
Период
Сортировка
От Sergiu Ignat
Тема XML element with special characters can be created, serialized, but not deserialized
Дата
Msg-id CAGtR-15ioG+_jPfZAX2b_YJnOJQSvB1u-sFrctTZ-gQnCZgitw@mail.gmail.com
обсуждение исходный текст
Ответы Re: XML element with special characters can be created, serialized, but not deserialized  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

Hello,

I am using PostgreSQL 13.8 and I think that I found an issue with XML serialization and deserialization.

A text that has special characters cannot be converted to XML even if it was created by serializing an XML element.

In our case a string contains a special character with the ASCII code 19, placed between the letters i and p.
The simple statement that serializes an XML element works.
select xmlelement(name "street",'i p')::text

When the same text has to be converted back to XML. it fails with an error

select xmlelement(name "street",'i p')::text::xml


The error message is

SQL Error [2200N]: ERROR: invalid XML content
  Detail: line 1: PCDATA invalid Char value 19
<street>i p</street>
         ^
line 1: chunk is not well balanced
<street>i p</street>
                    ^

The expected behaviour would be to successfully parse an XML element that was created and serialized by the same engine. 

Best regards,
--
Serghei Ignat

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dippu Kumar
Дата:
Сообщение: Need Support to Upgrade from 13.6 to 15.3
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: BUG #17911: Database or JDBC Driver Provides Incorrect Type