pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Noah Misch <noah@leadboat.com>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: libpq environment variables in the server
Date: Sat, 16 Mar 2019 09:39:48 +0100
Message-ID: <cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.com> (raw)
In-Reply-To: <20190315150112.GD2607362@rfd.leadboat.com>
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>
	<20190315150112.GD2607362@rfd.leadboat.com>

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




view thread (10+ messages)

Message-ID: <cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.com>
Permalink:  ../cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.com/
Also on:    postgresql.org/message-id/cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.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: peter.eisentraut@2ndquadrant.com, noah@leadboat.com, ilmari@ilmari.org
  Subject: Re: libpq environment variables in the server
  In-Reply-To: <cfd43269-b0e4-8b21-aabe-a11e4db86732@2ndquadrant.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