Contents

The pgmemento.audit_schema_log table can be seen as a config store for pgMemento. It does not only list which schema is logged since when, it also stores default settings which are applied for newly created tables, if this event trigger was enabled on initialization, e.g. the name of the audit_id column to be added to audited tables, and the logging behavior (log delta with old and/or new data). It contains the following columns:

  • id SERIAL: Primary Key
  • log_id INTEGER NOT NULL: ID to trace a changing schema
  • schema_name TEXT NOT NULL: The name of the audited schema
  • default_audit_id_column TEXT NOT NULL: The name for the audit_id column added to (existing and) newly created tables
  • default_log_old_data BOOLEAN NOT NULL: Flag that shows if old values are logged for (existing and) newly created tables
  • default_log_new_data BOOLEAN NOT NULL: Flag that shows if new values are logged for (existing and) newly created tables
  • txid_range numrange: Stores the transaction IDs when auditing for schema has been started and stopped

Note that the settings for single tables can differ, as auditing can be enabled per table. Check the audit_table_log table or the audit_tables view to see which audit_id column was added and how logging is configured. The audit_schema_log is filled when running the init function.