Re: log_statement = 'mod' does not log all data modifying statements

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Jack Christensen <jack(at)jackchristensen(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: log_statement = 'mod' does not log all data modifying statements
Date: 2015-09-09 14:24:53
Message-ID: A76B25F2823E954C9E45E32FA49D70ECCD515094@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Stephen Frost
Sent: Wednesday, September 09, 2015 10:17 AM
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Jack Christensen <jack(at)jackchristensen(dot)com>; pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] log_statement = 'mod' does not log all data modifying statements

* Bruce Momjian (bruce(at)momjian(dot)us) wrote:
> On Fri, Jun 12, 2015 at 01:54:30PM -0500, Jack Christensen wrote:
> > I was recently surprised by changes that were not logged by
> > log_statement = 'mod'. After changing log_statement to 'all', I
> > found that the changes were occurring in a writable CTE.
> >
> > Is there a way to log all statements that update data?
>
> Not really. Is this something we should document better?

pg_audit handles this (it is one of the specific goals of that project, in fact) and the case where modifications are done inside of DO blocks and PL code. Further, it provides a great deal of additional flexibility.

What we need here is better logging/auditing capabilities in core.
Improving the documentation for the back-branches is good but doesn't address this use-case. It's unfortunate that we don't have a better answer at this time.

Thanks!

Stephen

_______________________

Could you please provide reference to pg_audit?

TIA,
Igor Neyman

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2015-09-09 14:52:02 Re: [GENERAL] Feature Request: bigtsvector
Previous Message Stephen Frost 2015-09-09 14:17:05 Re: log_statement = 'mod' does not log all data modifying statements