Re: which commands under PostgreSQL do the similar func provided by "show processlist" under mysql

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: which commands under PostgreSQL do the similar func provided by "show processlist" under mysql
Date: 2005-06-06 17:55:45
Message-ID: 60u0kbmkta.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ying_lu(at)cs(dot)concordia(dot)ca (Ying Lu) writes:
> Greetings,
>
> I have a question about how to see current processes running under
> postgreSQL.
>
> "show processlist" will display DB, command, time, State, etc under MySQL:
>
> | Id | User | Host | db | Command | Time |
> *State * | *Info*
> | 21 | admin | server1:40898 | test | *Query* | 104 |
> Copying to tmp table | INSERT INTO test (SELECT ... ...
>
>
> May I know which commands to display similar current running
> commands/states under PostgreSQL please?

The nearest rough equivalent would be the contents of the system table
pg_catalog.pg_stat_activity.

This will only contain actual query information if the database is
configured to collect statistics on queries, so it's possible for the
field current_query to be left blank...
--
(format nil "~S(at)~S" "cbbrowne" "acm.org")
http://www.ntlug.org/~cbbrowne/sap.html
Rules of the Evil Overlord #78. "I will not tell my Legions of Terror
"And he must be taken alive!" The command will be: ``And try to take
him alive if it is reasonably practical.''"
<http://www.eviloverlord.com/>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ying Lu 2005-06-06 18:10:16 Re: which commands under PostgreSQL do the similar func
Previous Message Tom Lane 2005-06-06 17:55:40 Re: pg_dump 8.0.3 failing against PostgreSQL 7.3.2