Recording SELECT statements in PostgreSQL 8.4

Posted by David Anniwell on Stack Overflow See other posts from Stack Overflow or by David Anniwell
Published on 2010-04-16T15:33:01Z Indexed on 2010/04/18 16:53 UTC
Read the original article Hit count: 400

Filed under:
|
|
|
|

Hi All

I've got a table which contains sensitive data and according to data protection policy we have to keep a record of every read/write of the data including a row identifier and the user who accessed the table. The writing is no issue using triggers but obviously triggers aren't supported for SELECT statements.

What's the best method of doing this? I've looked at rules but I can't get them to INSERT into a table, and I've tried logging every query but this doesn't seem to log SELECT statements. Ideally for security I'd like to keep the log within a table on the database but logging to a file is fine too.

Thanks David

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about sql