Re: Bash function from psql (v14) - Mailing list pgsql-general

From Vijaykumar Jain
Subject Re: Bash function from psql (v14)
Date
Msg-id CAM+6J97=EqdFSH+Shs_GE4WSgVmHRAppWZAM4XYH7L73xOuoLQ@mail.gmail.com
Whole thread Raw
In response to Bash function from psql (v14)  (Murthy Nunna <mnunna@fnal.gov>)
List pgsql-general
On Sat, 9 Nov 2024 at 23:11, Murthy Nunna <mnunna@fnal.gov> 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
separatescript instead of a function works, but I do not want to do that. I have too many variables to be passed back
andforth. 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



pgsql-general by date:

Previous
From: "Efrain J. Berdecia"
Date:
Subject: Re: Bash function from psql (v14)
Next
From: user
Date:
Subject: Fwd: Fwd: Postgres attach partition: AccessExclusive lock set on different tables depending on how attaching is performed