pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: libpq environment variables in the server
Date: Fri, 15 Mar 2019 08:01:12 -0700
Message-ID: <20190315150112.GD2607362@rfd.leadboat.com> (raw)
In-Reply-To: <d8j4l845u56.fsf@dalvik.ping.uio.no>
References: <33383613-690e-6f1b-d5ba-4957ff40f6ce@2ndquadrant.com>
	<744962da-c27f-c992-4058-364463857ee0@2ndquadrant.com>
	<20190303080620.GA1750246@rfd.leadboat.com>
	<35af0500-5eea-d2f0-339e-07a457a5f6bc@2ndquadrant.com>
	<20190315040053.GB2607362@rfd.leadboat.com>
	<872a3a54-a169-acfc-322a-f6c5b8e89ece@2ndquadrant.com>
	<d8j4l845u56.fsf@dalvik.ping.uio.no>

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.




view thread (10+ messages)  latest in thread

Message-ID: <20190315150112.GD2607362@rfd.leadboat.com>
Permalink:  ../20190315150112.GD2607362@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20190315150112.GD2607362@rfd.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, ilmari@ilmari.org, peter.eisentraut@2ndquadrant.com
  Subject: Re: libpq environment variables in the server
  In-Reply-To: <20190315150112.GD2607362@rfd.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox