Postgres Login Users Details

Started by Vishalakshi Navaneethakrishnanover 13 years ago4 messagesgeneral
Jump to latest
#1Vishalakshi Navaneethakrishnan
nvishalakshi@sirahu.com

Hi all,

I need to know who are all access database from different remote host.

Example :

User1@host1 logged / access db dbuser@dbname in Dbserver

How can i get this information?

Thanks in advance..

--
Best Regards,
Vishalakshi.N

#2Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: Vishalakshi Navaneethakrishnan (#1)
Re: Postgres Login Users Details

On Mon, Oct 22, 2012 at 2:17 PM, Vishalakshi Navaneethakrishnan <
nvishalakshi@sirahu.com> wrote:

Hi all,

I need to know who are all access database from different remote host.

Example :

User1@host1 logged / access db dbuser@dbname in Dbserver

How can i get this information?

Thanks in advance..

Try log_line_prefix parameter, which has many option of writing information
into database server logs(pg_logs). You can get IP address of the user who
is accessing db, also the application name. Try %r option.

http://www.postgresql.org/docs/9.2/static/runtime-config-logging.html

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

#3Chris Angelico
rosuav@gmail.com
In reply to: Vishalakshi Navaneethakrishnan (#1)
Re: Postgres Login Users Details

On Mon, Oct 22, 2012 at 7:47 PM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:

Hi all,

I need to know who are all access database from different remote host.

Example :

User1@host1 logged / access db dbuser@dbname in Dbserver

How can i get this information?

As suggested, you can configure logging to record this. For
up-to-the-moment "who's currently logged in" information, look at the
pg_stat_activity table.

ChrisA

#4Vishalakshi Navaneethakrishnan
nvishalakshi@sirahu.com
In reply to: Chris Angelico (#3)
Re: Postgres Login Users Details

Hi,

In my case is different. i have only 2 DB login user.. say postgres and
dbuser1

My other friends login into this db server using different app server say
app1,app2.

Their user names are osuser1,osuser2

I want to know who is logging via which server and what db they are access
and what queries they are running ..

osuser1 from app1 login into dbserver as dbuser1 and accessing dbname1 db
and execute this command..

I want this details..

Can you help me how to log this information?

On Mon, Oct 22, 2012 at 8:20 PM, Chris Angelico <rosuav@gmail.com> wrote:

On Mon, Oct 22, 2012 at 7:47 PM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:

Hi all,

I need to know who are all access database from different remote host.

Example :

User1@host1 logged / access db dbuser@dbname in Dbserver

How can i get this information?

As suggested, you can configure logging to record this. For
up-to-the-moment "who's currently logged in" information, look at the
pg_stat_activity table.

ChrisA

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Best Regards,
Vishalakshi.N