Re: [GENERAL] psql doesn't pass on exported shell environmentfunctions
| От | Albe Laurenz |
|---|---|
| Тема | Re: [GENERAL] psql doesn't pass on exported shell environmentfunctions |
| Дата | |
| Msg-id | A737B7A37273E048B164557ADEF4A58B53A80042@ntex2010i.host.magwien.gv.at обсуждение исходный текст |
| Ответ на | [GENERAL] psql doesn't pass on exported shell environment functions ("David G. Johnston" <david.g.johnston@gmail.com>) |
| Ответы |
Re: [GENERAL] psql doesn't pass on exported shell environment functions
|
| Список | pgsql-general |
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
В списке pgsql-general по дате отправления: