-
Notifications
You must be signed in to change notification settings - Fork 3
Installation
Download the latest binary release from: https://bintray.com/mcafee/postgresql-audit-plugin/release.
Development snapshot builds are available at: https://bintray.com/mcafee/postgresql-audit-plugin/dev-snapshot (follow the latest version link and then the "Files" link). These builds are right off the trunk. They are usually stable, but do have a higher chance of containing new bugs.
Make sure to download the proper binary distribution. There are separate binaries for PostgreSQL 9.2.13, 9.3.0, 9.4.0 and 9.5.0, according to platform (32 or 64 bit). The 9.x.0 binaries are expected to work for all the minor releases.
The following assumes your PostgreSQL installation is in something like
/usr/psgl-95. Adjust the paths to suit your local setup.
-
Shut down the database first:
/etc/init.d/postgresql-9.5 stop -
Unzip the distribution. Install the files into the database's directory:
cp ./audit.so /usr/pgsql-9.5/lib/audit.so cp ./audit.control /usr/pgsql-9.5/share/extension/ cp ./udit--1.0.sql /usr/pgsql-9.5/share/extension/ -
Edit the PostgreSQL configuration file,
/var/lib/pgsql/9.5/data/postgresql.confFind the line withshared_preload_librariesand change it to read:shared_preload_libraries = 'audit' -
To enable logging to a file, add this line:
audit.json_file = 1
-
Restart the database:
/etc/init.d/postgresql-9.5 start
See: Configuration
See: Troubleshooting