File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 66# change to path of psql
77PSQL=' /usr/pgsql-9.2/bin/psql'
88
9- # change to database you're targeting
10- DBNAME =' postgres'
9+ # list all databases you're targeting, space separated
10+ DBNAMES =' postgres mydatabase '
1111
1212# modify if required
1313DBPORT=' '
1414DBHOST=' '
1515
16- $PSQL -c " SELECT log_transaction_locks();" -U postgres $DBNAME $DBPORT $DBHOST
17- $PSQL -c " SELECT log_table_locks();" -U postgres $DBNAME $DBPORT $DBHOST
16+ for DBNAME in $DBNAMES ; do
17+ $PSQL -c " SELECT log_transaction_locks();" -U postgres $DBNAME $DBPORT $DBHOST
18+ $PSQL -c " SELECT log_table_locks();" -U postgres $DBNAME $DBPORT $DBHOST
19+ done
1820
1921# $PSQL -c "INSERT INTO activity_log SELECT * FROM pg_stat_activity;" -U postgres $DBNAME $DBPORT $DBHOST
2022
You can’t perform that action at this time.
0 commit comments