title: Logging SELECT statements in PostgreSQL 8.4
body: <p>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 triggers aren't supported for <code>SELECT</code> statements.</p>
  
  <p>What's the best method of doing this? I've looked at rules but I can't get them to <code>INSERT</code> into a table, and I've tried logging every query but this doesn't seem to log <code>SELECT</code> 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.</p>
  
  <p>Thanks,<br />
  David</p>