By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,708 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,708 IT Pros & Developers. It's quick & easy.

pid of current session?

P: n/a
Hello pgsql-general,

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

Thanks!

--
-Boris

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.