Re: [PROPOSAL] Make PSQLVAR on \getenv opitional

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Matheus Alcantara <msalcantara(dot)dev(at)pm(dot)me>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PROPOSAL] Make PSQLVAR on \getenv opitional
Date: 2021-12-28 20:45:40
Message-ID: a58c208c-4828-abe7-dde2-ec4a9a19da61@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 12/28/21 14:53, Tom Lane wrote:
> Matheus Alcantara <msalcantara(dot)dev(at)pm(dot)me> writes:
>>> 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
>> I think that the basic use case would be just for debugging, instead call \getenv and them \echo, we could just use \getenv. I don't see any other advantages, It would just be to
>> write fewer commands. I think that ^z and then fg is a good alternative, since this behavior would be inconsistent.
> You don't even need to do that much. This works fine:
>
> postgres=# \! echo $PATH
>
> So I'm not convinced that we need another way to spell that.
> (Admittedly, this probably doesn't work on Windows, but
> I gather that environment variables are less interesting there.)
>
>

I haven't tested, but I'm fairly sure

postgres=# \! echo %PATH%

would do the trick on Windows.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-12-28 21:04:27 Re: Column Filtering in Logical Replication
Previous Message Matheus Alcantara 2021-12-28 20:18:57 Re: [PROPOSAL] Make PSQLVAR on \getenv opitional