Log statements by username

From: Dávið Klein Sundsskarð <ds(at)neoconsult(dot)dk>
To: pgsql-admin(at)postgresql(dot)org
Subject: Log statements by username
Date: 2007-11-06 11:24:46
Message-ID: 47304EFE.2090808@neoconsult.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

We have a database that is accessible to quite a few users. (Using their
own account name of course)
Our goal is to be able to log the users UPDATE statements, so that we
can track down changes that were not done by our application software.

Altering the log_statement parameter is not an option, since this
would generate enormous amounts of statements. I'm interested in certain
users only. (or in fact all but one user)

One approach i have tried is to create a RULE that filters queries from
the application software user out. It then updates a log table for every
update, but i am unable to get a hold of the actual query that is executing.

Any ideas?

Regards,
David

Browse pgsql-admin by date

  From Date Subject
Next Message j a 2007-11-06 17:36:45 Vacuum Doesn't Recover Disk Space
Previous Message Peter Koczan 2007-11-05 17:39:26 Re: psql schemas