Re: Is there a way to list running queries - Mailing list pgsql-general

From Gregory S. Williamson
Subject Re: Is there a way to list running queries
Date
Msg-id 71E37EF6B7DCC1499CEA0316A2568328024BBE70@loki.wc.globexplorer.net
Whole thread Raw
In response to Is there a way to list running queries  (frank church <pgsql@adontendev.net>)
List pgsql-general
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_activitysystem 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_statementto '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
contentionsfor tables/rows, etc. More information might help people give you a better answer. 

HTH,

Greg Williamson
DBA
GlobeXplorer LLC




pgsql-general by date:

Previous
From: frank church
Date:
Subject: Is there a way to list running queries
Next
From: Zlatko Matić
Date:
Subject: numeric data type?