Error code

PostgreSQL 22001

POSTGRESQL22001
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

string_data_right_truncation — a value is too long for the column.

How to fix it

  1. Increase the column length with ALTER TABLE ... ALTER COLUMN ... TYPE VARCHAR(n) for the new maximum.
  2. Truncate or validate the value in application code before writing.
  3. Review whether the column definition adequately captures the expected maximum length.

Not affiliated with PostgreSQL. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.