| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Sean Chittenden <sean(at)chittenden(dot)org> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: pg_stat_get_backen_last_activity() ??? |
| Date: | 2003-01-17 23:23:10 |
| Message-ID: | 19691.1042845790@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Sean Chittenden <sean(at)chittenden(dot)org> writes:
> I can already identify that. Using the PID of the backend + sockstat
> on both the DB server and on the remote www server I can get the PID
> of the webserver process causing the problem, but I have no clue which
> customer, which page, which query, etc. The www process is doing
> something along the lines of:
> BEGIN;
> SELECT....
> [waits forever]
> END;
Oh, you want to know the actual current query. Turn on
stats_command_string or whatever it's called. See the statistics
collector documentation.
If this is after-the-fact (ie, you want to know about a process that's
hung right now), attach to it with a debugger and print out
debug_query_string.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jon Swinth | 2003-01-17 23:25:48 | Re: Fix FK deadlock, but no magic please |
| Previous Message | Hiroshi Inoue | 2003-01-17 23:20:46 | Re: [INTERFACES] Strange error accessing *views* from Linux through ODBC |