2200T
PostgreSQLERRORCriticalData ExceptionHIGH confidence

invalid XML processing instruction

What this means

SQLSTATE 2200T is raised when an XML processing instruction is syntactically invalid or uses the reserved name "xml" (case-insensitive).

Why it happens
  1. 1An XML processing instruction uses the reserved target name xml or XML
  2. 2A processing instruction is syntactically malformed
How to reproduce

XML with an invalid processing instruction.

trigger — this will error
trigger — this will error
SELECT XMLPARSE(DOCUMENT '<?xml-stylesheet type="text/xsl" href="style.xsl"?><r/>');

expected output

ERROR:  invalid XML processing instruction

Fix

Avoid using xml as the processing instruction target name

WHEN When generating XML with processing instructions.

Why this works

The XML specification reserves the name xml (case-insensitive) for the XML declaration. Use a different target name for custom processing instructions.

Sources
Official documentation ↗

Class 22 — Data Exception

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All PostgreSQL errors