Postgres process listing

If you're used to SHOW PROCESSLIST; or mysqladmin processlist in MySQL, you might be searching for this same functionality in postgresql. Here's the quick way to get a process list in postgresql:

Switch to the postgres user:
# su - postgres

Get into the postgres shell:
# psql

Then run a quick query:
select * from pg_stat_activity;

NOTE: To actually see the queries being run, you will need logging enabled (it's disabled by default). I don't know how to turn it on yet, so this post will be left open until I find out!

Printed from: http://rackerhacker.com/2007/06/06/postgres-process-listing/ .
© Major Hayden 2012.

1 Comment   »

Trackbacks/Pingbacks

  1. IT security news

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this