Re: libpq environment variables in the server

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq environment variables in the server
Date: 2019-03-16 08:39:48
Message-ID: cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-03-15 16:01, Noah Misch wrote:
>>>> {
>>>> local %ENV;
>>>> delete $ENV{PGAPPNAME};
>>>> ...
>>>> }
>>>
>>> That doesn't work because the first line clears the entire environment.
>>
>> The solution to that is to do 'local %ENV = %ENV;', to assign a copy of
>> the original to the localised variable.
>
> That's the right thing, not what I wrote. We use that in
> src/bin/initdb/t/001_initdb.pl.

Great. Committed that way.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-03-16 08:40:26 RE: Timeout parameters
Previous Message Fabien COELHO 2019-03-16 08:18:34 Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ