X-Original-To: pgsql-announce-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B9D6C52971; Sat, 30 Apr 2005 19:11:48 -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 81501-01; Sat, 30 Apr 2005 22:11:43 +0000 (GMT) Received: from smtp20.libero.it (smtp20.libero.it [193.70.192.147]) by svr1.postgresql.org (Postfix) with ESMTP id E80A1535E8; Sat, 30 Apr 2005 19:11:41 -0300 (ADT) Received: from localhost (172.16.1.83) by smtp20.libero.it (7.0.027-DD01) id 41D02C9801AF2D22; Sun, 1 May 2005 00:11:43 +0200 Received: from [151.25.97.219] (151.25.97.219) by smtp2.libero.it (7.0.027-DD01) (authenticated as tdezotti@inwind.it) id 41BF65E406F48A9D; Sun, 1 May 2005 00:12:02 +0200 Message-ID: <42740256.4090200@streppone.it> Date: Sun, 01 May 2005 00:10:30 +0200 From: Cosimo Streppone User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-announce@postgresql.org Cc: "DBD:"@svr1.postgresql.org:Pg list , pgsql-sql@postgresql.org Subject: pgtop, display PostgreSQL processes in `top' style Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at libero.it serv4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/1 X-Sequence-Number: 694 Hi everybody, I'm currently working on something like a `mytop' clone, also written in Perl with DBI + DBD::Pg interface. mytop is a command line utility that displays mysql server status and clients connected modeled after `top' unix utility. (http://mytop.sourceforge.net). What I'd like to achieve is something like that, but for PostgreSQL, of course. Now the project is in the very early stages, but it already does something useful with Pg backend versions 7.2+ with stats enabled. Obviously, it looks at pg_stat* relations to extract some useful information. There are some things that are nice in `mytop', and I think it would be nice to have also in `pgtop', but I don't know how to replicate them: 1) is it possible to know Pg backend uptime with SQL queries? Or must I look at postmaster.pid file? or even something else? 2) how can I know the ip addresses/hostnames of clients connecting to server? 3) Is there a way to know the number of queries performed against Pg backend (by each client)? Can I distinguish between selects / updates / inserts / copy / ... ? If you want to take a look at it, point your browser at http://search.cpan.org/dist/pgtop . -- Cosimo