From a936743b336ed0b53f1ddb28b4535f4c27bd2b23 Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Sun, 17 May 2015 09:56:57 -0400 Subject: pg_audit Makefile, REINDEX changes Clean up the Makefile, per Michael Paquier. Classify REINDEX as we do in core, use '1.0' for the version, per Fujii. --- contrib/pg_audit/Makefile | 10 +++++----- contrib/pg_audit/pg_audit--1.0.0.sql | 22 ---------------------- contrib/pg_audit/pg_audit--1.0.sql | 22 ++++++++++++++++++++++ contrib/pg_audit/pg_audit.c | 6 ------ contrib/pg_audit/pg_audit.control | 2 +- 5 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 contrib/pg_audit/pg_audit--1.0.0.sql create mode 100644 contrib/pg_audit/pg_audit--1.0.sql diff --git a/contrib/pg_audit/Makefile b/contrib/pg_audit/Makefile index bd6897e534..9ba2e4d361 100644 --- a/contrib/pg_audit/Makefile +++ b/contrib/pg_audit/Makefile @@ -1,13 +1,13 @@ -# pg_audit/Makefile +# contrib/pg_audit/Makefile -MODULE = pg_audit MODULE_big = pg_audit -OBJS = pg_audit.o +OBJS = pg_audit.o $(WIN32RES) EXTENSION = pg_audit +DATA = pg_audit--1.0.sql +PGFILEDESC = "pg_audit - An audit logging extension for PostgreSQL" + REGRESS = pg_audit -REGRESS_OPTS = -DATA = pg_audit--1.0.0.sql ifdef USE_PGXS PG_CONFIG = pg_config diff --git a/contrib/pg_audit/pg_audit--1.0.0.sql b/contrib/pg_audit/pg_audit--1.0.0.sql deleted file mode 100644 index 9d9ee83f73..0000000000 --- a/contrib/pg_audit/pg_audit--1.0.0.sql +++ /dev/null @@ -1,22 +0,0 @@ -/* pg_audit/pg_audit--1.0.0.sql */ - --- complain if script is sourced in psql, rather than via CREATE EXTENSION -\echo Use "CREATE EXTENSION pg_audit" to load this file.\quit - -CREATE FUNCTION pg_audit_ddl_command_end() - RETURNS event_trigger - LANGUAGE C - AS 'MODULE_PATHNAME', 'pg_audit_ddl_command_end'; - -CREATE EVENT TRIGGER pg_audit_ddl_command_end - ON ddl_command_end - EXECUTE PROCEDURE pg_audit_ddl_command_end(); - -CREATE FUNCTION pg_audit_sql_drop() - RETURNS event_trigger - LANGUAGE C - AS 'MODULE_PATHNAME', 'pg_audit_sql_drop'; - -CREATE EVENT TRIGGER pg_audit_sql_drop - ON sql_drop - EXECUTE PROCEDURE pg_audit_sql_drop(); diff --git a/contrib/pg_audit/pg_audit--1.0.sql b/contrib/pg_audit/pg_audit--1.0.sql new file mode 100644 index 0000000000..457f2c65ba --- /dev/null +++ b/contrib/pg_audit/pg_audit--1.0.sql @@ -0,0 +1,22 @@ +/* pg_audit/pg_audit--1.0.sql */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION pg_audit" to load this file.\quit + +CREATE FUNCTION pg_audit_ddl_command_end() + RETURNS event_trigger + LANGUAGE C + AS 'MODULE_PATHNAME', 'pg_audit_ddl_command_end'; + +CREATE EVENT TRIGGER pg_audit_ddl_command_end + ON ddl_command_end + EXECUTE PROCEDURE pg_audit_ddl_command_end(); + +CREATE FUNCTION pg_audit_sql_drop() + RETURNS event_trigger + LANGUAGE C + AS 'MODULE_PATHNAME', 'pg_audit_sql_drop'; + +CREATE EVENT TRIGGER pg_audit_sql_drop + ON sql_drop + EXECUTE PROCEDURE pg_audit_sql_drop(); diff --git a/contrib/pg_audit/pg_audit.c b/contrib/pg_audit/pg_audit.c index 13928cda21..4b75fefc34 100644 --- a/contrib/pg_audit/pg_audit.c +++ b/contrib/pg_audit/pg_audit.c @@ -540,12 +540,6 @@ log_audit_event(AuditEventStackItem *stackItem) class = LOG_READ; break; - /* Reindex is DDL (because cluster is DDL) */ - case T_ReindexStmt: - className = CLASS_DDL; - class = LOG_DDL; - break; - /* FUNCTION statements */ case T_DoStmt: className = CLASS_FUNCTION; diff --git a/contrib/pg_audit/pg_audit.control b/contrib/pg_audit/pg_audit.control index 6730c68916..40c0b0a883 100644 --- a/contrib/pg_audit/pg_audit.control +++ b/contrib/pg_audit/pg_audit.control @@ -1,5 +1,5 @@ # pg_audit extension comment = 'provides auditing functionality' -default_version = '1.0.0' +default_version = '1.0' module_pathname = '$libdir/pg_audit' relocatable = true -- cgit v1.2.3