diff options
author | Fujii Masao <fujii@postgresql.org> | 2014-07-10 14:27:54 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2014-07-10 14:27:54 +0900 |
commit | 5b214c5dd1de37764797b3fb9164af3c885a7b86 (patch) | |
tree | 2bfde2150e2abaf04fe947f13843c6c8117f3d6c /src/bin/psql/common.c | |
parent | b043985b7aaf62f6978a0c567c8340ad9cf1ad67 (diff) |
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.
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r-- | src/bin/psql/common.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |