SQLSTATE 22P05Severity mediumLab verified

Incident brief

Untranslatable character between encodings

Converting text to a target encoding fails when a character has no representation there; the euro sign (U+20AC) has no LATIN1 equivalent.

What lands in your log

ERROR: character with byte sequence 0xe2 0x82 0xac in encoding "UTF8" has no equivalent in encoding "LATIN1"

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

In 10 seconds

What triggers it
Call convert_to(text, encoding) where the text contains a character the target encoding cannot represent.
Fix
Convert to an encoding that can represent the characters (UTF8 or LATIN9 cover the euro sign).
Proof
Reproduced on PostgreSQL 18.4 → A single SELECT reproduces SQLSTATE 22P05; the euro sign cannot be encoded as LATIN1 and the conversion is refused.

Fix

What to do right now

Application-level steps for this error.

  • Convert to an encoding that can represent the characters (UTF8 or LATIN9 cover the euro sign).
  • Strip or transliterate unsupported characters before converting to a narrow encoding like LATIN1.
Fix SQL
-- Convert only characters the target encoding can represent.
SELECT convert_to('EUR', 'LATIN1');

Connected

Everything this error touches

Every page this SQLSTATE connects to: the concept that explains it, the runbooks that fix it, the parameters you tune to prevent it, and the sibling errors it travels with. All real cross-references. Jump straight in, or open the full interactive map.

Open in the interactive map →

Verification

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

Went further?

Pro unlocks the second lab proof

Free page stops the bleeding. Pro adds the operational test, SQLSTATE audit, and deeper evidence, same error, more certainty.

FollowSubstackLinkedInnew errors · lab notes · hiring loops