Re: Currently connected users...

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Currently connected users...
Date: 2010-01-21 16:44:00
Message-ID: 20100121164400.GA6916@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dhimant Patel <drp4kri(at)gmail(dot)com> wrote:

> I'm a beginner Postgres user, and need quick hint from someone.
>
>
> How could I know which users are currently connected to postgres instance?

You can use pg_stat_activity:

select * from pg_stat_activity

Or, if you need only the usernames:

select usename from pg_stat_activity ;

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Frankel 2010-01-21 17:34:54 db cluster location
Previous Message Thomas Kellerer 2010-01-21 16:43:52 Re: Currently connected users...