Re: log_statement per table

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: log_statement per table
Дата
Msg-id FD3BC4A1-AEBE-4A74-A96A-E814558751B4@blighty.com
обсуждение исходный текст
Ответ на log_statement per table  (David Janssens <david.j@almacom.co.th>)
Ответы Re: log_statement per table  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
On Mar 4, 2014, at 2:19 AM, 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?

You might want to look at trigger based audit logs.

Some example code, and a couple of useful packages:

http://www.postgresql.org/docs/current/static/plpgsql-trigger.html#PLPGSQL-TRIGGER-AUDIT-EXAMPLE
https://github.com/disqus/pg_audit
http://pgfoundry.org/projects/tablelog/
http://jimmyg.org/blog/2007/audit-tables-in-postgresql-with-debian.html
http://www.varlena.com/GeneralBits/104.php

Cheers,
  Steve

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Read tables of sql server with postgres
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: Why is varchar_pattern_ops needed?