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: Add a \getenv command to psql.
Date: Mon, 20 Dec 2021 19:16:05 +0000
Message-ID: <E1mzO8j-0000Yy-WE@gemulon.postgresql.org> (raw)

Add a \getenv command to psql.

\getenv fetches the value of an environment variable into a psql
variable.  This is the inverse of the \setenv command that was added
over ten years ago.  We'd not seen a compelling use-case for \getenv
at the time, but upcoming regression test refactoring provides a
sufficient reason to add it now.

Discussion: https://postgr.es/m/1655733.1639871614@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/33d3eeadb21d2268104840cfef6bc2226ddfc680

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml     | 22 ++++++++++++++++++++
src/bin/psql/command.c             | 41 ++++++++++++++++++++++++++++++++++++++
src/test/regress/expected/psql.out | 12 +++++++++++
src/test/regress/sql/psql.sql      | 12 +++++++++++
4 files changed, 87 insertions(+)



Message-ID: <E1mzO8j-0000Yy-WE@gemulon.postgresql.org>
Permalink:  ../E1mzO8j-0000Yy-WE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mzO8j-0000Yy-WE@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add a \getenv command to psql.
  In-Reply-To: <E1mzO8j-0000Yy-WE@gemulon.postgresql.org>
  References: <E1mzO8j-0000Yy-WE@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