pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmail.com>
To: stuff@opensourceonline.com <stuff@opensourceonline.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: oracle v$session equivalent in postgresql
Date: Fri, 5 Nov 2004 20:53:00 +0100
Message-ID: <1d581afe0411051153dce7837@mail.gmail.com> (raw)
In-Reply-To: <20041105152808.GAFG3261.fed1rmmtao07.cox.net@CYGNUS>
References: <20041105152808.GAFG3261.fed1rmmtao07.cox.net@CYGNUS>

On Fri, 5 Nov 2004 08:27:58 -0700, stuff@opensourceonline.com
<stuff@opensourceonline.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@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@gmail.com



view thread (3+ messages)

Message-ID: <1d581afe0411051153dce7837@mail.gmail.com>
Permalink:  ../1d581afe0411051153dce7837@mail.gmail.com/
Also on:    postgresql.org/message-id/1d581afe0411051153dce7837@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: barwick@gmail.com, stuff@opensourceonline.com
  Subject: Re: oracle v$session equivalent in postgresql
  In-Reply-To: <1d581afe0411051153dce7837@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox