The default branch in extract_column_value_static attempts to read any unrecognized Postgres type as Option<String>:
_ => {
let value: Option<String> = row
.try_get(column_index)
.map_err(|_| Error::InvalidRecord)?;
Ok(value
.map(serde_json::Value::String)
.unwrap_or(serde_json::Value::Null))
}
If the type cannot be deserialized as String (arrays, composite types, ranges, etc.), it returns Error::InvalidRecord with no indication of which column or type caused the failure. There are many common Postgres types not covered: arrays (_INT4, _TEXT), enums, INTERVAL, INET,CIDR, MACADDR, TSVECTOR, POINT, JSONPATH, etc.
Fix: Log the type name and column name before falling through to the default. Consider using row.try_get_raw() and converting to a text representation as a more robust fallback. At minimum: warn!("Unknown column type '{}' for column '{}', attempting String fallback", type_name, column.name());
The default branch in
extract_column_value_staticattempts to read any unrecognized Postgres type asOption<String>:If the type cannot be deserialized as String (arrays, composite types, ranges, etc.), it returns
Error::InvalidRecordwith no indication of which column or type caused the failure. There are many common Postgres types not covered: arrays (_INT4,_TEXT), enums,INTERVAL,INET,CIDR,MACADDR,TSVECTOR,POINT,JSONPATH, etc.Fix: Log the type name and column name before falling through to the default. Consider using
row.try_get_raw()and converting to a text representation as a more robust fallback. At minimum:warn!("Unknown column type '{}' for column '{}', attempting String fallback", type_name, column.name());