fn decode_error(error: ArrowError) -> PgWireErrorExpand description
Maps arrow-json errors to PostgreSQL’s COPY error classes, the
way csv.rs does. A field value that does not decode against its
column type is an invalid text representation (22P02): arrow-json
wraps those as JsonError("whilst decoding field '<name>': …") (see
its struct_array.rs), since it has no separate ParseError for
them. JSON syntax errors (truncated records, unexpected tokens) and
anything else is bad copy data (22P04) — never an internal XX000.