psql: set SHELL_ERROR and SHELL_EXIT_CODE in more places.
Tom Lane <tgl@sss.pgh.pa.us>
psql: set SHELL_ERROR and SHELL_EXIT_CODE in more places. Make the \g, \o, \w, and \copy commands set these variables when closing a pipe. We missed doing this in commit b0d8f2d98, but it seems like a good idea. There are some remaining places in psql that intentionally don't update these variables after running a child program: * pager invocations * backtick evaluation within a prompt * \e (edit query buffer) Corey Huinker and Tom Lane Discussion: https://postgr.es/m/CADkLM=eSKwRGF-rnRqhtBORRtL49QsjcVUCa-kLxKTqxypsakw@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/psql-ref.sgml | modified | +12 −4 |
| src/bin/psql/command.c | modified | +2 −14 |
| src/bin/psql/common.c | modified | +23 −3 |
| src/bin/psql/common.h | modified | +2 −0 |
| src/bin/psql/copy.c | modified | +1 −0 |
| src/bin/psql/psqlscanslash.l | modified | +4 −6 |
Documentation touched
Discussion
- Add SHELL_EXIT_CODE to psql 45 messages · 2022-11-04 → 2023-04-06