Re: libpq environment variables in the server

From: Noah Misch <noah(at)leadboat(dot)com>
To: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq environment variables in the server
Date: 2019-03-15 15:01:12
Message-ID: 20190315150112.GD2607362@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 15, 2019 at 10:06:29AM +0000, Dagfinn Ilmari Mannsåker wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2019-03-15 15:22:05 Re: Ordered Partitioned Table Scans
Previous Message Fabien COELHO 2019-03-15 14:44:42 Re: seems like a bug in pgbench -R