Re: DB Audit

From: bricklen <bricklen(at)gmail(dot)com>
To: misspaola(at)tiscali(dot)it
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: DB Audit
Date: 2013-12-10 16:21:26
Message-ID: CAGrpgQ-eErwE4UaDLpDczU7MKBEo97mv5PQyiGZhVOa==F=-ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Dec 10, 2013 at 6:53 AM, <misspaola(at)tiscali(dot)it> wrote:

> I am using sybase ase as dbms and I would migrate to postgresql, but
> the absence of a built in DB audit functionality is a show stopper for me.
>
> So I would know if there is a way to get information about DB events like:
>
> server boots
>
> login & logout
>
> table access.
> attempt to access particular objects
>
> particular user’s actions.
>

In addition to what Laurenz has mentioned,by default auditing does not
exist, but there are ways to add your own, some of which include:

- https://github.com/2ndQuadrant/audit-trigger
- Create views over your tables which also select a db function to log
SELECT access.
Eg.
create or replace view user_details as
select col1, col2, col3, col4, null as audit from some_table
union all select null, null, null, null, audit_function(current_user) as
func;

There are probably other options, but I can't think of any off the top of
my head at the moment. This question has come up in these lists before and
on Stack Overflow, so you might want to search around a bit for other
options.

In response to

  • DB Audit at 2013-12-10 14:53:13 from misspaola

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 2013-12-10 16:23:05 Question about optimizing access to a table.
Previous Message Merlin Moncure 2013-12-10 15:57:09 Re: Return setof values from C-function