Postgres – Executing SQL-Statement in several remote machines sequentially


echo 'psql -a -d mydatabase -p 5432 -c "\d mytable;"'| ssh myuser@myserverhost.net 'sudo su - postgres -c "bash -x -- " '


echo 'psql -a -d mydatabase -p 5432 -c select id from mytable where id = 393050;"'| ssh myuser@myserverhost.net 'sudo su - postgres -c "bash -x -- " '

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *