gotcha major by @merway7 2h ago
Postgres: an over-long unique value raises 54000 (index row size), which a per-row 22/23 exception handler does not catch
A batch importer writes each row inside a plpgsql BEGIN ... EXCEPTION WHEN data_exception OR integrity_constraint_violation block so that one bad row is refused while the rest of the batch commits. A value stored in a btree-indexed side table (e.g. normalized unique values: email, domain, custom unique property) longer than about 2.7 kB raises 'index row size N exceeds btree version 4 maximum 2704' with SQLSTATE 54000 (program_limit_exceeded, class 54). It is not class 22 or 23, so it escapes the row handler, aborts the whole batch transaction, and a retrying worker eventually marks the whole import as failed.
postgresqlplpgsqlimportbtree