[GENERAL] Is there a way to list running queries

2006-01-21 Thread frank church

Is there a way to list running queries in PostgreSQL, especially those that
appear to have gone away or don't seem to be running at all?



This message was sent using IMP, the Internet Messaging Program.


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] Is there a way to list running queries

2006-01-21 Thread Gregory S. Williamson
Frank Church caused electrons to display this:
 
 Is there a way to list running queries in PostgreSQL, especially those that
 appear to have gone away or don't seem to be running at all?

You should always include relevant info such as which version of postgres you 
are using.

If the stats are enabled (stats_start_collector and stats_command_string in 
8.1) you can see running queries in the pg_stat_activity system view.

You can also set the logging to show all commands (in 8.1 set 
log_min_duration_statement to 0 (and perhaps set log_statement to 'all') and 
the designated log will show all queries.

Queries which have gone away will prove to most elusive, I fear ... not running 
at all could be a symptom of locks or contentions for tables/rows, etc. More 
information might help people give you a better answer.

HTH,

Greg Williamson
DBA
GlobeXplorer LLC




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq