Re: oracle v$session equivalent in postgresql

From: Ian Barwick <barwick(at)gmail(dot)com>
To: "stuff(at)opensourceonline(dot)com" <stuff(at)opensourceonline(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: oracle v$session equivalent in postgresql
Date: 2004-11-05 19:53:00
Message-ID: 1d581afe0411051153dce7837@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, 5 Nov 2004 08:27:58 -0700, stuff(at)opensourceonline(dot)com
<stuff(at)opensourceonline(dot)com> wrote:
>
> I'm looking for the equivalent in postgresql to the v$session variables in
> Oracle. In particular, I need to convert the following statement:
>
> select s.program, s.machine into :New.app_name,:New.comp_name from v$session
> s where s.audsid=userenv('SESSIONID');

You want basically this information then:

SQL> select s.program, s.machine from v$session s where
s.audsid=userenv('SESSIONID');

PROGRAM
------------------------------------------------
MACHINE
----------------------------------------------------------------
sqlplus(at)linux (TNS V1-V3)
linux

There's no direct equivalent of v$session in PostgreSQL, and I don't
know any way of determining the client program name (AFAIK). More
information about monitoring user activity can be found e.g. here:
http://www.postgresql.org/docs/current/static/monitoring.html

Ian Barwick
barwick(at)gmail(dot)com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2004-11-06 08:17:43 Re: Simple SQL Question
Previous Message Tomasz Myrta 2004-11-05 18:09:55 Re: Simple SQL Question