Re: Is there a way to list running queries

From: "Gregory S(dot) Williamson" <gsw(at)globexplorer(dot)com>
To: "frank church" <pgsql(at)adontendev(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to list running queries
Date: 2006-01-21 12:48:51
Message-ID: 71E37EF6B7DCC1499CEA0316A2568328024BBE70@loki.wc.globexplorer.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_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

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-01-21 13:08:30 Re: [GENERAL] Creation of tsearch2 index is very slow
Previous Message Ron 2006-01-21 12:22:32 Re: [GENERAL] Creation of tsearch2 index is very