From: | Dhandapani Shanmugam <postgresql95(at)gmail(dot)com> |
---|---|
To: | Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: user logging info |
Date: | 2016-06-02 09:03:34 |
Message-ID: | CAAj4MFG8RjDPnJFiFcF8XpN6EkRK45agz10PCA9DEN7YuRj7yg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Thank for your response Glyn,
>-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 want to see the list of user who logged into XXX database in last 90
days. How can we do this please
On Thu, Jun 2, 2016 at 2:17 PM, Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk> wrote:
> > From: Dhandapani Shanmugam <postgresql95(at)gmail(dot)com>
> >To: pgsql-admin(at)postgresql(dot)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
> >
> >
>
From | Date | Subject | |
---|---|---|---|
Next Message | hubert depesz lubaczewski | 2016-06-02 09:44:49 | Re: user logging info |
Previous Message | Glyn Astill | 2016-06-02 08:47:04 | Re: user logging info |