How to identify the offending field in `django.db.utils.DataError: value too long for type character varying(...)`

When the error is in the log, but the data that caused it is no longer available, sometimes there’s no way of telling which field was the one that couldn’t store the longer string (when there are several fields with the same length).

Would it be possible to tweak something so the exception type django.db.utils.DataError brought this info in the message?

The underlying database, in my case, is PostgreSQL 18 with psycopg==3.3.6