From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add psql variables to track success/failure of SQL queries.
Date: Tue, 12 Sep 2017 23:28:36 +0000
Message-ID: <E1drubc-0007B7-7T@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Add psql variables to track success/failure of SQL queries.
In-Reply-To: <E1drubc-0007B7-7T@gemulon.postgresql.org>
References: <E1drubc-0007B7-7T@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox