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

From Greg Sabino Mullane
Subject Re: Bash function from psql (v14)
Date
Msg-id CAKAnmmL2ib1=-x-kpqaWPL6RoLa4qbeFWAeSGEB5SZ2pyeTLPA@mail.gmail.com
Whole thread Raw
In response to Bash function from psql (v14)  (Murthy Nunna <mnunna@fnal.gov>)
Responses RE: Bash function from psql (v14)
List pgsql-general
What problem are you trying to solve? If you tell us that, we can guide you to some better solutions.

There are numerous issues here, but the most important are:

1) Calling a shell via \! invokes an entirely new process: there is no link to the parent or grandparent process

2) The run-bash-function must be declared before being called, so that bash code was never going to work anyway. In other words, this is valid:

run-bash-function() { echo "Here we are"; }

run-bash-function

This version is not:

run-bash-function

run-bash-function() { echo "Here we are"; }


Cheers,
Greg

pgsql-general by date:

Previous
From: user
Date:
Subject: Fwd: Fwd: Postgres attach partition: AccessExclusive lock set on different tables depending on how attaching is performed
Next
From: Murthy Nunna
Date:
Subject: RE: Bash function from psql (v14)