Re: log_statement per table

From: Venkata Balaji Nagothi <vbnpgc(at)gmail(dot)com>
To: David Janssens <david(dot)j(at)almacom(dot)co(dot)th>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: log_statement per table
Date: 2014-03-04 23:56:45
Message-ID: CAHBAh5t1d4Q6cacC-tdtr2m2sVBLWLju2tZhgWY1Y=mxOjP24g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Mar 4, 2014 at 9:19 PM, David Janssens <david(dot)j(at)almacom(dot)co(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2014-03-05 01:50:42 Re: How to recovery failed master after failover
Previous Message Rob Sargent 2014-03-04 21:08:33 Re: Offending My Tender Sensibilities -OR- OLTP on a Star Schema