Add SHELL_ERROR and SHELL_EXIT_CODE magic variables to psql.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/psql-ref.sgml | modified | +28 −0 |
| src/bin/psql/command.c | modified | +15 −0 |
| src/bin/psql/help.c | modified | +4 −0 |
| src/bin/psql/psqlscanslash.l | modified | +21 −3 |
| src/common/wait_error.c | modified | +19 −0 |
| src/include/port.h | modified | +1 −0 |
Documentation touched
Discussion
- Add SHELL_EXIT_CODE to psql 45 messages · 2022-11-04 → 2023-04-06