Add SHELL_ERROR and SHELL_EXIT_CODE magic variables to psql.
These are set after a \! command or a backtick substitution.
SHELL_ERROR is just "true" for error (nonzero exit status) or "false"
for success, while SHELL_EXIT_CODE records the actual exit status
following standard shell/system(3) conventions.
Corey Huinker, reviewed by Maxim Orlov and myself
Discussion: https://postgr.es/m/CADkLM=cWao2x2f+UDw15W1JkVFr_bsxfstw=NGea7r9m4j-7rQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b0d8f2d983cb25d1035fae1cd7de214dd67809b4
Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 28 ++++++++++++++++++++++++++++
src/bin/psql/command.c | 15 +++++++++++++++
src/bin/psql/help.c | 4 ++++
src/bin/psql/psqlscanslash.l | 24 +++++++++++++++++++++---
src/common/wait_error.c | 19 +++++++++++++++++++
src/include/port.h | 1 +
6 files changed, 88 insertions(+), 3 deletions(-)