From 5b214c5dd1de37764797b3fb9164af3c885a7b86 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Thu, 10 Jul 2014 14:27:54 +0900 Subject: Add new ECHO mode 'errors' that displays only failed commands in psql. When the psql variable ECHO is set to 'erros', only failed SQL commands are printed to standard error output. Also this patch adds -b option into psql. This is equivalent to setting the variable ECHO to 'errors'. Pavel Stehule, reviewed by Fabrízio de Royes Mello, Samrat Revagade, Kumar Rajeev Rastogi, Abhijit Menon-Sen, and me. --- src/bin/psql/common.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/bin/psql/common.c') diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index c08c81366d1..676e2680af6 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -995,6 +995,9 @@ SendQuery(const char *query) results = NULL; /* PQclear(NULL) does nothing */ } + if (!OK && pset.echo == PSQL_ECHO_ERRORS) + psql_error("STATEMENT: %s\n", query); + /* If we made a temporary savepoint, possibly release/rollback */ if (on_error_rollback_savepoint) { -- cgit v1.2.3