Re: pid of current session?

From: Boris Popov <boris(at)procedium(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pid of current session?
Date: 2003-11-06 22:02:14
Message-ID: 26276287049.20031106140214@procedium.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Thursday, November 6, 2003, 1:48:25 PM, I wrote:

BP> Is there a way to tell which session from 'select * from
BP> pg_stat_activity' is a current session? Obviously if there's way
BP> to find out pid of a current session by some other means I could
BP> then look the rest in pg_stat_activity.

Please nevermind, I must have missed it in the docs the first time.

select * from pg_stat_activity where procpid = pg_backend_pid();

--
-Boris

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Barbara Lindsey 2003-11-06 22:05:56 create function for trigger question
Previous Message Craig O'Shannessy 2003-11-06 21:53:18 Optimiser desicion bringing system to its knees?