SQLSTATE 22P05 ERROR Class 22: Data Exception

untranslatable_character character with byte sequence … in encoding “…” has no equivalent in encoding “…” — 22P05

PostgreSQL error "character with byte sequence … in encoding "…" has no equivalent in encoding "…"" (SQLSTATE 22P05): what it means, common causes, and …

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Diagnostic Queries

Symptoms

A character that is valid in one encoding has no representation in the target encoding during conversion. PostgreSQL raises SQLSTATE 22P05 (untranslatable_character).

  • Happens when converting between database and client encodings.
  • The message names both encodings and the byte sequence.
  • Typical when a database is LATIN1 but the data contains characters only in UTF-8.

What the server log shows

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

Why PostgreSQL raises this — what the manual says

Section 23.3.3 Automatic Character Set Conversion Between Server and Client:

“If the conversion of a particular character is not possible — suppose you chose EUC_JP for the server and LATIN1 for the client, and some Japanese characters are returned that do not have a representation in LATIN1 — an error is reported.”

When the client and database encodings differ, PostgreSQL converts each character through its conversion tables. A character with no mapping in the destination encoding (e.g. € into LATIN1) cannot be converted and fails with 22P05.

Common causes

  • A LATIN1 database receiving characters that only exist in UTF-8.
  • A client encoding too narrow for the stored data.
  • Mixing encodings across an application stack.

How to fix it

  1. Use a UTF-8 database encoding so all characters are representable.
  2. Set client_encoding to one that covers the data.
  3. Sanitize/transliterate characters that the target encoding cannot store.

Related & next steps

Reference: PostgreSQL 18 Section 24.3 “Character Set Support”.

Was this helpful?