Re: log_statement per table - Mailing list pgsql-general

From Venkata Balaji Nagothi
Subject Re: log_statement per table
Date
Msg-id CAHBAh5t1d4Q6cacC-tdtr2m2sVBLWLju2tZhgWY1Y=mxOjP24g@mail.gmail.com
Whole thread Raw
In response to log_statement per table  (David Janssens <david.j@almacom.co.th>)
List pgsql-general

On Tue, Mar 4, 2014 at 9:19 PM, David Janssens <david.j@almacom.co.th> wrote:
Hello,
I would like to log statements that modify a small subset of tables in a databases.
(not all tables, because the log files become too big in that case and I also worry about performance)
I currently use log_statement='mod' but I didn't find a way to limit this to the set of tables I want.
What is the best way to do this?

Not sure if this solution would help or may be you have already looked at this possibility.

If you know which user is performing the activities on those tables, you can look at the possibility of setting the log_statement='all' at a user level by saying "alter role <username> set log_statement='all' ". This would log all the statements executed by that particular user. You can think of doing this if you think do not end up having a big logfile.

Or

In my experience, i have configured a separate user with separate set of logging mechanism and use to monitor all the activities performed by that user.

Venkata Balaji N

Sr. Database Administrator
Fujitsu Australia 

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Offending My Tender Sensibilities -OR- OLTP on a Star Schema
Next
From: Michael Paquier
Date:
Subject: Re: How to recovery failed master after failover