Excerpts from David Fetter's message of lun jun 28 12:00:47 -0400 2010:
> While tracking this down, I didn't see a way to get SQLSTATE or the
> corresponding condition name via psql. Is this an oversight? A bug,
> perhaps?
IIRC
\pset VERBOSITY verbose
to get the SQLSTATE.
I don't think you can get the condition name that way, though.