Search Postgresql Archives

Re: Bash function from psql (v14)

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

 



On Sat, 9 Nov 2024 at 23:11, Murthy Nunna <mnunna@xxxxxxxx> wrote:

> I am trying to code bash function and call it from psql. But it is failing. How can I get this to work. Creating a separate script instead of a function works, but I do not want to do that. I have too many variables to be passed back and forth. Any ideas?

> Run the above script:
>
> ./test-bash-function.sh
>
> sh: line 1: run-bash-function: command not found
>
> in bash function
>
>

/*

postgres@ubuntu:/tmp$ echo 'whoami' >> myscript.sh
postgres@ubuntu:/tmp$ chmod a+x myscript.sh
postgres@ubuntu:/tmp$ psql <<EOS
\! bash /tmp/myscript.sh
EOS

postgres

*/



-- 
Thanks,
Vijay

Open to work
Resume - Vijaykumar Jain






[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux