How can I access the numeric code of an error in psql
?
For example, in this case I would like to get the value 23503 ("foreign_key_violation") as documented here: https://www.postgresql.org/docs/current/errcodes-appendix.html
postgres=# insert into t values('bb');
ERROR: insert or update on table "t" violates foreign key constraint "fd"
-- How can I see the numeric error code here?