PG
PRO
2200GERRORTier 2 — Caution✅ HIGH confidence

most specific type mismatch

Category: Data ExceptionVersions: All Postgres versions

What this means

SQLSTATE 2200G is raised in SQL/XML or typed-table contexts when the most specific type of a value does not match the expected type hierarchy. It is primarily relevant to SQL structured type hierarchies.

Why it happens

  1. 1In a typed table or SQL/XML operation, the value type does not conform to the declared most specific type

How to reproduce

SQL structured type mismatch in typed tables.

trigger — this will ERROR
ERROR: most specific type mismatch

Fix 1: Ensure the value type matches the typed table column declaration

When working with SQL structured types.

fix

Why this works

Review the typed table definition and ensure inserted values conform to the declared type hierarchy.

Sources

📚 Official docs: https://www.postgresql.org/docs/current/errcodes-appendix.html

🔧 Source ref: Class 22 — Data Exception

Confidence assessment

✅ HIGH confidence

Standard SQLSTATE. Rarely encountered outside SQL structured type usage.

See also

📄 Reference pages

Typed TablesSQL/XML
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →