Re: libpq environment variables in the server

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Noah Misch <noah@leadboat.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-03-16T08:39:48Z
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


Commits

  1. Don't propagate PGAPPNAME through pg_ctl in tests