err_hash() blindly calls SvCUR(DBIc_ERR(imp_xxh)), which might fail if the SV doesn't have a PV. This causes assertions with DBD::Pg and DBD::mysql on debugging perls, because they only ever sv_setiv() it.
Minimal reproduction:
$ perl -MDBI -e 'print DBI->install_driver("Pg")->{Version}'
perl: DBI.xs:866: err_hash: Assertion `PL_valid_types_PVX[((svtype)((_svcur)->sv_flags & 0xff)) & 0xf] || ((svtype)((_svcur)->sv_flags & 0xff)) == SVt_REGEXP' failed.