Received: from corvette.mascari.com (dhcp9595024.columbus.rr.com [24.95.95.24]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA97364; Wed, 31 May 2000 19:34:23 -0400 (EDT) (envelope-from mascarm@mascari.com) Received: from mascari.com (ferrari.mascari.com [192.168.2.1]) by corvette.mascari.com (8.9.3/8.9.3) with ESMTP id TAA09362; Wed, 31 May 2000 19:32:05 -0400 Message-ID: <3935A118.3D03B7DB@mascari.com> Date: Wed, 31 May 2000 19:32:40 -0400 From: Mike Mascari Organization: Mascari Development Inc X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: mikeo CC: pgsql-sql@postgreSQL.org, pgsql-general@postgreSQL.org Subject: Re: TOP SESSIONS? References: <3.0.1.32.20000530113504.009563b0@pop.spectrumtelecorp.com> <3.0.1.32.20000530113504.009563b0@pop.spectrumtelecorp.com> <3.0.1.32.20000531144117.0096a940@pop.spectrumtelecorp.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/602 mikeo wrote: > > hi, > in oracle you would use these two cursors to determine who was connected and > what they were doing. > > select distinct s.sid sid, s.serial# serial, s.status status, osuser, spid , > count(o.sid) counter, s.username username, s.program program, sql_address > from v$session s, v$open_cursor o, v$process p > where s.sid = o.sid(+) > and paddr = addr > group by s.sid,s.serial#, s.status , osuser, spid ,s.username, s.program ,sql_address > order by 1,3 > > select distinct name > from sys.audit_actions, v$sqltext > where address = ? > and action = command_type > > does anyone know what tables in postgres would give me the same or similar information? > > TIA, > mikeo PostgreSQL attempts to communicate what queries are being performed by setting the process information in the connected backend when processing a SQL statement, much like sendmail. You should be able to determine who's connected and what they're doing with something like: ps axf You'll see who's connected to what database from what machine and the type of query being executed. I don't know of any tables in PostgreSQL which would provide similar information. Hope that helps, Mike Mascari