Im preparing a shell script to generate analyze command and all the commands will go to a variable.
Now I want to run one by one, and Im able to achieve that by using the below command.
for $i in $analyze_query
psql -h host -U user -d db -c"$i"
But this query will close and open a new connection for every command, Is there any way that I can run the one by one but in one session?