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 fails. The expected usage of these
is for scripting.
Fabien Coelho, reviewed by Pavel Stehule
Discussion: https://postgr.es/m/alpine.DEB.2.20.1704042158020.12290@lancre
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/69835bc8988812c960f4ed5aeee86b62ac73602a
Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 44 +++++++++++++
src/bin/psql/common.c | 71 ++++++++++++++++++++
src/bin/psql/help.c | 11 +++-
src/bin/psql/startup.c | 4 ++
src/test/regress/expected/psql.out | 131 +++++++++++++++++++++++++++++++++++++
src/test/regress/sql/psql.sql | 64 ++++++++++++++++++
6 files changed, 324 insertions(+), 1 deletion(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers