On 12nd of September 2017, Tom Lane committed patch: Add psql variables to track success/failure of SQL queries. This patch adds ERROR, SQLSTATE, and ROW_COUNT, which are updated after every query, as well as LAST_ERROR_MESSAGE and LAST_ERROR_SQLSTATE, which are updated only when a query ...

Yet another missed thing for "Waiting for 9.3". Sorry about that. On 29th of January, Tom Lane committed patch: Provide database object names as separate fields in error messages. This patch addresses the problem that applications currently have to extract object names from possibly-localized ...

On 18th of July, Tom Lane committed patch: Add GET STACKED DIAGNOSTICS plpgsql command to retrieve exception info. This is more SQL-spec-compliant, more easily extensible, and better performing than the old method of inventing special variables. Pavel Stehule, reviewed by Shigeru Hanada and David ...

One common problem that a lot of people seem to have is when they encounter error message like this: # \i test.sql psql:test.sql:1: ERROR: invalid byte sequence for encoding "UTF8": 0xb3 Why it happens? What can be done about it? Let's ...