pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: psql: set SHELL_ERROR and SHELL_EXIT_CODE in more places.
Date: Thu, 06 Apr 2023 21:33:44 +0000
Message-ID: <E1pkXEl-001jwW-BS@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/31ae2aa9d2c200a0d7d3283d749669a408ec7b65

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml | 16 ++++++++++++----
src/bin/psql/command.c         | 16 ++--------------
src/bin/psql/common.c          | 26 +++++++++++++++++++++++---
src/bin/psql/common.h          |  2 ++
src/bin/psql/copy.c            |  1 +
src/bin/psql/psqlscanslash.l   | 10 ++++------
6 files changed, 44 insertions(+), 27 deletions(-)



Message-ID: <E1pkXEl-001jwW-BS@gemulon.postgresql.org>
Permalink:  ../E1pkXEl-001jwW-BS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pkXEl-001jwW-BS@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: psql: set SHELL_ERROR and SHELL_EXIT_CODE in more places.
  In-Reply-To: <E1pkXEl-001jwW-BS@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox