Re: Currently connected users... - Mailing list pgsql-general

From Andreas Kretschmer
Subject Re: Currently connected users...
Date
Msg-id 20100121164400.GA6916@tux
Whole thread Raw
In response to Currently connected users...  (Dhimant Patel <drp4kri@gmail.com>)
List pgsql-general
Dhimant Patel <drp4kri@gmail.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°

pgsql-general by date:

Previous
From: Dhimant Patel
Date:
Subject: Currently connected users...
Next
From: Thomas Kellerer
Date:
Subject: Re: Currently connected users...