From: | Christopher Kings-Lynne <chris(dot)kings-lynne(at)calorieking(dot)com> |
---|---|
To: | PostgreSQL Advocacy <pgsql-advocacy(at)postgresql(dot)org> |
Subject: | pgqueryspy |
Date: | 2006-06-27 08:47:24 |
Message-ID: | 44A0F09C.7050407@calorieking.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-advocacy |
This seems new:
http://dotnot.org/blog/archives/2006/02/22/spying-on-postgresql/
"You have tuned your PostgreSQL database, and you, of course, turned off
query logging, but a problem has cropped up. How can you see the
activity on your database at any slice of time?
Like me, you have probably turned on command stats to view
pg_stat_activity, but that gives you only moment in time. You could use
ethereal to capture the Postgres queriy packets, but then what? What if
you don’t have X installed? tcpdump you say? What do you do with the dump?
Enter pgqueryspy.
Simply type pgqueryspy 2000 db0 to capture the next 2000 packets to the
server named ‘db0′. pgqueryspy then prints out the queries that it
intercepts in the packet stream for your consumption on the command
line. It even tosses those pesky “BEGIN” and “END” queries for you.
Not too terribly invasive, no load on your database, and you find out
NOW what is happening with your database. Code is available here:
pgqueryspy.c."
From | Date | Subject | |
---|---|---|---|
Next Message | David Fetter | 2006-06-27 17:19:58 | Re: pgqueryspy |
Previous Message | Koen Martens | 2006-06-25 09:26:15 | Re: postgresql live-cd |