0

I'm quite versed in postgresql, but new to any extension other than postgis. for example, one of the first things I do when setting up an instance is to install postgis in template1, so it's available in every db I create (most of them handle geospatial data).

I'd like something similar for pg_cron and pgaudit, but I'm not sure it's required. are these extensions "one per cluster" or do they need installing in each separate database?

I believe pgaudit is per server, as it records everything, but confirmation would be helpful.

pg_cron I'm not so sure about.

thanks all!

Chris
  • 185
  • 1
  • 3
  • 7

1 Answers1

1

Some of the pgaudit functionality, specifically auditing of the DDL commands, is implemented using event triggers, which only work in the database(s) where they are created, so you'll miss that functionality unless you create the pgaudit extension in each database that you want to audit.

The pg_cron database objects, in particular the job definition table, can only exist in one database on the server, the database defined by the cron.database_name configuration parameter, so you can only create the extension in that one database.

mustaccio
  • 28,207
  • 24
  • 60
  • 76