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 6AD70D1B193 for ; Wed, 30 Jun 2004 05:44:39 -0300 (ADT) 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 20583-08 for ; Wed, 30 Jun 2004 08:44:38 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 955D9D1B1D0 for ; Wed, 30 Jun 2004 05:44:36 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i5U8iXQC086616 for ; Wed, 30 Jun 2004 08:44:33 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i5U8hsvq086560 for pgsql-admin@postgresql.org; Wed, 30 Jun 2004 08:43:54 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.admin Subject: Re: How to list what queries are running in postgres? Date: Wed, 30 Jun 2004 10:43:51 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 42 Message-ID: <40E27D47.1000908@bigfoot.com> References: <20040623213446.GA31224@pmg.xs4all.nl> <40E1DCCD.5060907@bigfoot.com> <3246.1088566642@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr To: Tom Lane User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en In-Reply-To: <3246.1088566642@sss.pgh.pa.us> X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/394 X-Sequence-Number: 14054 Tom Lane wrote: > Gaetano Mendola writes: > >>P.A.M. van Dam wrote: >> >>>I'm looking for a command or method to find out what queries are >>>currently being serviced by the database. > > >>select * from pg_stat_activity; > > > ... having first remembered to turn on stats_command_string; and > thou shalt also be superuser. > > [ anybody else remember Monty Python's scriptures concerning the > Holy Hand Grenade? ] Do you mean this ? Then did he raise on high the Holy Hand Grenade of Antioch, saying, "Bless this, O Lord, that with it thou mayst blow thine enemies to tiny bits, in thy mercy." And the people did rejoice and did feast upon the lambs and toads and tree-sloths and fruit-bats and orangutans and breakfast cereals ... Now did the Lord say, "First thou pullest the Holy Pin. Then thou must count to three. Three shall be the number of the counting and the number of the counting shall be three. Four shalt thou not count, neither shalt thou count two, excepting that thou then proceedeth to three. Five is right out. Once the number three, being the number of the counting, be reached, then lobbest thou the Holy Hand Grenade in the direction of thine foe, who, being naughty in my sight, shall snuff it." :-) Regards Gaetano Mendola