Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David G. Johnston wrote:
> In hindsight I'm not surprised but couldn't find a ready explanation on the web and
> figured I'd inquire here.  In short: "export VAR" and "export -f functionname" behave
> differently when psql is acting as a relay.

It works for me on Linux with 9.6.3 psql:

laurenz:~> cat psql-call-bash
#!/usr/bin/env bash

echo "Enter"
echo "EnvVar: $TEST_ENVVAR"
echo "Invoking Function..."

testfunction

exit
laurenz:~> chmod 0700 psql-call-bash
laurenz:~> function testfunction() { echo "Function Test"; }
laurenz:~> export -f testfunction
laurenz:~> export TEST_ENVVAR='Test'
laurenz:~> psql
Border style is 2.
Line style is unicode.
psql (9.6.3)
Type "help" for help.

test=> \!
laurenz:~> ./psql-call-bash
Enter
EnvVar: Test
Invoking Function...
Function Test

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux