pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Glyn Astill <glynastill@yahoo.co.uk>
To: Dhandapani Shanmugam <postgresql95@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: user logging info
Date: Thu, 2 Jun 2016 08:47:04 +0000 (UTC)
Message-ID: <2019574206.5819817.1464857224506.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <CAAj4MFES75wcVzO+K52PetsfFROUQ0bNMdJHn4HW0G-sb8D+uA@mail.gmail.com>
References: <CAAj4MFES75wcVzO+K52PetsfFROUQ0bNMdJHn4HW0G-sb8D+uA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

> From: Dhandapani Shanmugam <postgresql95@gmail.com>
>To: pgsql-admin@postgresql.org 
>Sent: Thursday, 2 June 2016, 7:21
>Subject: [ADMIN] user logging info
> 
>
>
>Hi All,
>
>
>Good Day!
>
>
>Please clarify me on below points :)
>
>
>-Can we see user connections on any system tables(active + past) in postgreSQL, Please share me the SQL if it is possible.

>

Can you clarify what you want to see here?  You can see the current and last queries of connections with "SELECT * FROM pg_stat_activity".  If you want auditing or logging of all activity then depending on what you need it's possible with triggers or an extension like pg_audit.

>
>-.I assume postgresql.conf can be modified so that user connections are logged in a log file. 

>

Yes turn on log_connections and log_disconnections, see the "what to log" section here:

    https://www.postgresql.org/docs/current/static/runtime-config-logging.html

>>Is this best approach or how can we do to check for the user connection details? any advise is really helpful. Thanks in Advance
>
>
>-Dhandapani
>
>


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



view thread (6+ messages)  latest in thread

Message-ID: <2019574206.5819817.1464857224506.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../2019574206.5819817.1464857224506.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/2019574206.5819817.1464857224506.JavaMail.yahoo@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: glynastill@yahoo.co.uk, postgresql95@gmail.com
  Subject: Re: user logging info
  In-Reply-To: <2019574206.5819817.1464857224506.JavaMail.yahoo@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox