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

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'David G(dot) Johnston *EXTERN*'" <david(dot)g(dot)johnston(at)gmail(dot)com>
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 14:43:19
Message-ID: A737B7A37273E048B164557ADEF4A58B53A80207@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

I copied and pasted a shell session:

First, show the script that contains a function invocation.
Then, define and export the function.
Then, call psql
Then, escape to a subshell.
Then, call the script that successfully calls the function.

Am I missing something?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2017-07-07 15:00:10 Re: Postgresql - commercial version
Previous Message Adrian Klaver 2017-07-07 14:18:11 Re: Postgresql - commercial version