Best way to monitor, control, or rewrite data definition commands?

Поиск
Список
Период
Сортировка
От Turner, Ian
Тема Best way to monitor, control, or rewrite data definition commands?
Дата
Msg-id 8744EE476651744882371AB948473F0B159E7E@mailnyc2.nyc.deshaw.com
обсуждение исходный текст
Ответы Re: Best way to monitor, control, or rewrite data definition commands?  (Greg Smith <gsmith@gregsmith.com>)
Re: Best way to monitor, control, or rewrite data definition commands?  (John DeSoi <desoi@pgedit.com>)
Список pgsql-general
Hello list,

I am trying to implement automatic audit log tracking for newly created
tables. When a user creates a table, I would like to create a second
table for the audit log, along with the relevant rules. So for example,
if a user does

CREATE TABLE foo (fooid integer);

Then I would also like to do

CREATE TABLE foo_audit (fooid integer, <other columns>);

along with the creation of some other triggers, rules, etc.

Is there any way to be notified when a user executes data definition
commands such as CREATE TABLE? It doesn't appear possible to apply
triggers or rules to the system tables, and the query rewrite engine
only seems to apply to SELECT, INSERT, and UPDATE. Thoughts?

Cheers,

--Ian Turner

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_dump/pg_restore schema and data separately and foreign key constraints
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Best way to monitor, control, or rewrite data definition commands?