SQLSTATE 2200NSeverity lowLab verified

Incident brief

Invalid XML content (CONTENT)

XMLPARSE(CONTENT ...) still requires well-formed markup; an unclosed tag raises this data exception with a DETAIL about the premature end of data.

Reproduced on PostgreSQL 18.4Verified 2026-07-24 (isolated lab, PostgreSQL 18.4)Reviewed by Verified against PostgreSQL 18.4 in an isolated lab environment

In 10 seconds

What
Invalid XML content (CONTENT)
What triggers it
Call XMLPARSE(CONTENT '<...>') with content that has an unclosed tag.
The fix
Close every tag so the fragment is well-formed.
Proof
Reproduced on PostgreSQL 18.4 → A single SELECT reproduces SQLSTATE 2200N; the unclosed <total> tag is rejected as invalid content.

The fix

What to do right now

The immediate, application-level response to this error.

  • Close every tag so the fragment is well-formed.
  • Build the fragment with a serializer instead of string assembly.
Fix — SQL
-- Provide well-formed XML content.
SELECT XMLPARSE(CONTENT '<order><total>10</total></order>');

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 18.4
Last verified
2026-07-24 (isolated lab, PostgreSQL 18.4)
Reviewed by
Verified against PostgreSQL 18.4 in an isolated lab environment
Audit status
reviewed