I do not think this is an easy way.
I tried installing VERBOSITY in psql, as I assumed this would help, but unfortunately not (at 9.4):
psql \set VERBOSITY verbose dbname=> create temporary table test (t varchar(5)); CREATE TABLE dbname=> insert into test values ('123456'); ERROR: 22001: value too long for type character varying(5) LOCATION: varchar, varchar.c:623
This may be something that requires discussion on the mailing list, since you are not the only one with this problem .
source share