Re: [PROPOSAL] Make PSQLVAR on \getenv opitional

From: Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Matheus Alcantara <msalcantara(dot)dev(at)pm(dot)me>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PROPOSAL] Make PSQLVAR on \getenv opitional
Date: 2021-12-28 21:38:12
Message-ID: YcuDxPSEmSo8V4HA@elch.exwg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

## Pavel Stehule (pavel(dot)stehule(at)gmail(dot)com):

> it is not consistent with other \g* commands. Maybe a new statement \senv
> ? But what is the use case? You can just press ^z and inside shell write
> echo $xxx, and then fg

That does not work: backgrounding psql will put you into your original
shell, the parent process of psql. Changes in the environment of a
process do not change the environment of the parent.
Use \! to start a new shell process from psql, which will inherit psql's
environment.

Regards,
Christoph

--
Spare Space

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema 2021-12-28 22:19:20 Re: [EXTERNAL] Re: Add ETIMEDOUT to ALL_CONNECTION_FAILURE_ERRNOS
Previous Message Alvaro Herrera 2021-12-28 21:04:27 Re: Column Filtering in Logical Replication