Re: libpq environment variables in the server - Mailing list pgsql-hackers

From Noah Misch
Subject Re: libpq environment variables in the server
Date
Msg-id 20190315150112.GD2607362@rfd.leadboat.com
Whole thread Raw
In response to Re: libpq environment variables in the server  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
Responses Re: libpq environment variables in the server
List pgsql-hackers
On Fri, Mar 15, 2019 at 10:06:29AM +0000, Dagfinn Ilmari Mannsåker wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> 
> > On 2019-03-15 05:00, Noah Misch wrote:
> >> I consider the following style more idiomatic:
> >> 
> >>  {
> >>      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.


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: seems like a bug in pgbench -R
Next
From: David Rowley
Date:
Subject: Re: Ordered Partitioned Table Scans