Skip site navigation (1) Skip section navigation (2)


From: Mike Mascari <mascarm(at)mascari(dot)com>
To: mikeo <mikeo(at)spectrumtelecorp(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org, pgsql-general(at)postgreSQL(dot)org
Subject: Re: TOP SESSIONS?
Date: 2000-05-31 23:32:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-sql
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

In response to

pgsql-sql by date

Next:From: Jan WieckDate: 2000-06-01 02:24:58
Subject: Re: [SQL] Re: create view security
Previous:From: Kyle BatemanDate: 2000-05-31 19:56:07
Subject: Re: create constraint trigger

pgsql-general by date

Next:From: Ed LoehrDate: 2000-05-31 23:34:53
Subject: Re: Postmaster won't -HUP
Previous:From: Joseph ShraibmanDate: 2000-05-31 23:18:43
Subject: Re: Postmaster won't -HUP

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group