| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Add a \getenv command to psql. |
| Date: | 2021-12-20 19:16:05 |
| Message-ID: | E1mzO8j-0000Yy-WE@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(+)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2021-12-20 19:16:06 | pgsql: Remove dynamic translation of regression test scripts, step 1. |
| Previous Message | John Naylor | 2021-12-20 14:10:07 | pgsql: Add fast path for validating UTF-8 text |