A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

View current queries in postgres

Edit config

sudo vim /var/lib/pgsql/9.0/data/postgresql.conf


Add this line:

stats_command_string = true


Restart

pg_ctl reload


Then

SELECT datname,procpid,current_query FROM pg_stat_activity


Thanks