On Thu, May 14, 2015 at 11:36 PM, Stephen Frost <sfr...@snowman.net> wrote: > Add pg_audit, an auditing extension > > This extension provides detailed logging classes, ability to control > logging at a per-object level, and includes fully-qualified object > names for logged statements (DML and DDL) in independent fields of the > log output. > > Authors: Ian Barwick, Abhijit Menon-Sen, David Steele > Reviews by: Robert Haas, Tatsuo Ishii, Sawada Masahiko, Fujii Masao, > Simon Riggs > > Discussion with: Josh Berkus, Jaime Casanova, Peter Eisentraut, > David Fetter, Yeb Havinga, Alvaro Herrera, Petr Jelinek, Tom Lane, > MauMau, Bruce Momjian, Jim Nasby, Michael Paquier, > FabrÃzio de Royes Mello, Neil Tiffin > > Branch > ------ > master > > Details > ------- > http://git.postgresql.org/pg/commitdiff/ac52bb0442f79076b14acd8ad5b696946c1053b8 > > Modified Files > -------------- > contrib/Makefile | 1 + > contrib/pg_audit/.gitignore | 5 + > contrib/pg_audit/Makefile | 21 + > contrib/pg_audit/expected/pg_audit.out | 964 ++++++++++++++++ > contrib/pg_audit/pg_audit--1.0.0.sql | 22 + > contrib/pg_audit/pg_audit.c | 1870 ++++++++++++++++++++++++++++++++ > contrib/pg_audit/pg_audit.conf | 1 + > contrib/pg_audit/pg_audit.control | 5 + > contrib/pg_audit/sql/pg_audit.sql | 617 +++++++++++ > doc/src/sgml/contrib.sgml | 1 + > doc/src/sgml/filelist.sgml | 1 + > doc/src/sgml/pgaudit.sgml | 678 ++++++++++++ > 12 files changed, 4186 insertions(+)
pg_audit uses 1.0.0 as its version number. But, is the third digit really required? Why? We usually uses the version number with two digits in contrib modules. CREATE EXTENSION pg_audit failed with the following error message when shared_preload_libraries and pg_audit.log are set to pg_audit and ddl, respectively. =# create extension pg_audit ; ERROR: pg_event_trigger_ddl_commands() can only be called in an event trigger function CONTEXT: SQL statement "SELECT UPPER(object_type), object_identity FROM pg_event_trigger_ddl_commands()" In Makefile, PGFILEDESC should be added. +# pg_audit/Makefile should be "# contrib/pg_audit/Makefile" for the consistency. The categories of some SQL commands are different between log_statement and pg_audit. For example, REINDEX is treated as DDL in pg_audit, but not in log_statement. That's confusing. We should use the same "category-mapping" rule as much as possible. Regards, -- Fujii Masao -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers