X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 91A933A3E72 for ; Fri, 5 Nov 2004 19:53:06 +0000 (GMT) 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 41467-05 for ; Fri, 5 Nov 2004 19:53:03 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.201]) by svr1.postgresql.org (Postfix) with ESMTP id EC54D3A3E69 for ; Fri, 5 Nov 2004 19:53:01 +0000 (GMT) Received: by rproxy.gmail.com with SMTP id a36so106492rnf for ; Fri, 05 Nov 2004 11:53:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=FFQDEoU55vjMGxhHbxAGkZXQqp/HMRS232Oh6h0fFft/7ddJyOvIZzD7XoVwiSOC1Mj2CPpn3N977nuRpMzyZysx9Tx+gtT13oZ86udA0qxKkgaIPjCph6sGrbP5jSKM/79LMALKiSNN9sFk/Z2npaLJnmQFmFJ1nRHYVLZgRfM= Received: by 10.38.209.1 with SMTP id h1mr508187rng; Fri, 05 Nov 2004 11:53:01 -0800 (PST) Received: by 10.38.78.38 with HTTP; Fri, 5 Nov 2004 11:53:00 -0800 (PST) Message-ID: <1d581afe0411051153dce7837@mail.gmail.com> Date: Fri, 5 Nov 2004 20:53:00 +0100 From: Ian Barwick Reply-To: Ian Barwick To: "stuff@opensourceonline.com" Subject: Re: oracle v$session equivalent in postgresql Cc: pgsql-sql@postgresql.org In-Reply-To: <20041105152808.GAFG3261.fed1rmmtao07.cox.net@CYGNUS> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20041105152808.GAFG3261.fed1rmmtao07.cox.net@CYGNUS> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200411/52 X-Sequence-Number: 19371 On Fri, 5 Nov 2004 08:27:58 -0700, 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