Installing pgaudit

pg_audit is supported on the same platforms as the Postgres distribution you're using. Support for pg_audit starts with Postgres 14. For details, see:

Installation

Before you begin the installation process:

Install the package

The syntax for the package install command is:

# For SLES, CentOS, RHEL and its derivatives

# Postgres versions 12 to 15
sudo <package-manager> -y install edb-<postgres><postgres_version>-pgaudit1

# Postgres versions16+
sudo <package-manager> -y install edb-<postgres><postgres_version>-pgaudit<postgres_version>

# For Debian and Ubuntu

# Postgres versions 12 to 15
sudo <package-manager> -y install edb-<postgres><postgres_version>-pgaudit-1

# Postgres versions 16+
sudo <package-manager> -y install edb-<postgres><postgres_version>-pgaudit-<postgres_version>

Where:

  • <package-manager>is the package manager used with your operating system:

    Package managerOperating system
    dnfRHEL 8/9 and derivatives
    yumRHEL 7 and derivatives, CentOS 7
    zypperSLES
    apt-getDebian and derivatives
  • <postgres> is the distribution of Postgres you're using:

    Postgres distributionValue
    PostgreSQLpg
    EDB Postgres Extended Serverpostgresextended
  • <postgres-version> is the version of Postgres you're using.

For example:

# RHEL/derivatives — PostgreSQL 15 and earlier
sudo dnf -y install edb-pg15-pgaudit1

# RHEL/derivatives — PostgreSQL 16 and later
sudo dnf -y install edb-pg16-pgaudit16

# RHEL/derivatives — EDB Postgres Extended Server
sudo dnf -y install edb-postgresextended17-pgaudit17

# Debian/Ubuntu — PostgreSQL 15 and earlier
sudo apt-get -y install edb-pg15-pgaudit-1

# Debian/Ubuntu — PostgreSQL 16 and later
sudo apt-get -y install edb-pg16-pgaudit-16

# Debian/Ubuntu — EDB Postgres Extended Server
sudo apt-get -y install edb-postgresextended17-pgaudit-17
Note
  • For Postgres 16 and later versions, the pgaudit extension major version is equal to the Postgres major version.
  • For Postgres 15 and earlier versions, the pgaudit extension major version is 1.

Could this page be better? Report a problem or suggest an addition!