X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8540C8B9F4D for ; Fri, 18 Feb 2005 01:52:28 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13254-10 for ; Fri, 18 Feb 2005 01:52:17 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 60E8F8B9CEA for ; Fri, 18 Feb 2005 01:51:44 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id j1I1pUrZ031482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Feb 2005 18:51:32 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id j1I1pTLL028484; Thu, 17 Feb 2005 18:51:29 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id j1I1pTuN028483; Thu, 17 Feb 2005 18:51:29 -0700 (MST) (envelope-from mfuhr) Date: Thu, 17 Feb 2005 18:51:29 -0700 From: Michael Fuhr To: "Patrick Hsieh(?????????)" Cc: pgsql-admin@postgresql.org Subject: Re: how to view running sessions ? Message-ID: <20050218015128.GA28345@winnie.fuhr.org> References: <359737a805021716571fd008b6@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <359737a805021716571fd008b6@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.003 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/161 X-Sequence-Number: 16329 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 "" 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/