Re: psql doesn't pass on exported shell environment functions

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql doesn't pass on exported shell environment functions
Date: 2017-07-07 15:12:44
Message-ID: CAKFQuwYE_a1S9eKmWNbqpgX_6AEGUHvw7FNXxBpvthJbOy-6tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 7, 2017 at 7:43 AM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
wrote:

> David G. Johnston wrote:
> >> It works for me on Linux with 9.6.3 psql:
> >
> > ​Except you haven't recreated the scenario I presented.​
> >
> > ​You only are involving a single script and that script defines
> "testfunction" itself
> > (which makes exporting pointless). In my example the script being
> executed within the
> > psql script does not define testfunction itself.
> >
> > -> == execute in subshell
> >
> > ​main-script (def func) -> psql -> psql-call-bash (invoke func)
>
> I am confused; my shell script does *not* contain a function definition.
>
> Am I missing something?
>

​Nope, it was a combination of ERRNOCAFFINE and not seeing a second script.

​I'm using Ubuntu 16.04

I tried your way of not using a "main-script" and got the same result.

I can see the exported environment variable TEST_ENVVAR in the "env" output
of the psql \! subshell. "declare -Fx" shows no results.

I replaced "/usr/bin/env bash" with "/bin/bash" to no effect.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2017-07-07 15:19:27 Re: psql doesn't pass on exported shell environment functions
Previous Message Tom Lane 2017-07-07 15:07:10 Re: psql doesn't pass on exported shell environment functions