session1_monitor.sh
application/x-shellscript
Filename: session1_monitor.sh
Type: application/x-shellscript
Part: 2
#!/bin/sh while true do psql -XAt foodb <<_EOF_ select case when pg_log_backend_memory_contexts(pid) then 'Tracing '||pid else 'Nope...' end from pg_stat_activity where query like '%/* TRACKME */%' and state = 'active' and pid<>pg_backend_pid(); _EOF_ sleep 1 done