Installing the SQL Profiler extension v9

You must install and enable the SQL Profiler extension on each server on which you want to use it. For example, if you have a host running PostgreSQL 14 and PostgreSQL 15, you must enable the extension on each server.

SQL Profiler is supported on the same platforms as the Postgres distribution you're using. Support for the SQL Profiler extension starts with version 11 for PostgreSQL and EDB Postgres Advanced Server and version 12 for EDB Postgres Extended. See:

Installing the package

Prerequisites

Before you begin the installation process:

Install the package

The syntax to install SQL Profiler on EDB Postgres Advanced Server and EDB Postgres Extended is:

# For EDB Postgres Advanced Server:
sudo <package-manager> -y install edb-as<postgres_version>-server-sqlprofiler

# For EDB Postgres Extended:
sudo <package-maanger> -y install edb-postgresextended<postgres_version>-sqlprofiler

Where:

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

    Package managerOperating system
    dnfRHEL 8 and derivatives
    zypperSLES
    apt-getDebian and derivatives
  • <postgres_version> is the version of Postgres you're using.

For example, to install the latest version of SQL Profiler for EDB Postgres Advanced Server 15 on a RHEL 8 platform:

sudo dnf -y install edb-as15-server-sqlprofiler

The syntax to install SQL Profiler on PostgreSQL is:

# For RHEL 8 and its derivatives:
sudo dnf -y install sqlprofiler_<postgres_version>

# For Debian/Ubuntu:
sudo apt-get -y install postgresql-<postres_version>-sqlprofiler

Where <postgres_version> is the version of PostgreSQL you're using.

Enabling the extension

To enable the extension:

  1. Edit the postgresql.conf file on the server you want to profile, modifying the shared_preload_libraries parameter:

    shared_preload_libraries = '$libdir/sql-profiler'
  2. Restart the Postgres server.

  3. Create the SQL Profiler extension in your maintenance database with the following command:

    # Connect to your maintenance database using psql
    psql -d postgres -U enterprisedb
    # Create the extension
    CREATE EXTENSION sql_profiler;
Note

If you are connected to the PEM server with the PEM client before configuring SQL Profiler, you must disconnect and reconnect with the server to enable SQL Profiler functionality.

After enabling the extension, SQL Profiler is ready to use with all databases that reside on the server.