Re: how to view running sessions ?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Patrick Hsieh(?????????)" <pahudnet(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to view running sessions ?
Date: 2005-02-18 01:51:29
Message-ID: 20050218015128.GA28345@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Feb 18, 2005 at 08:57:00AM +0800, Patrick Hsieh(?????????) wrote:

> Is there any why to see/view the running query sessions in the database?
> Something like "SHOW PROCESSLIST" in MySQL.

SELECT * FROM pg_stat_activity;

If the current_query column says "<command string not enabled>"
then edit postgresql.conf, set "stats_command_string = true" (and
make sure it's uncommented), and restart or reload the backend.

For more information, see the "Monitoring Database Activity" and
"Server Run-time Environment" chapters in the documentation.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Spiegelberg, Greg 2005-02-18 14:29:52 OID assistance
Previous Message Patrick Hsieh (謝洪恩) 2005-02-18 00:57:00 how to view running sessions ?