Installing the SQL Profiler extension

Installing the SQL Profiler extension#

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. See:

Installing the package#

Prerequisites#

Before you begin the installation process:

Setting up the repository is a one-time task. If you have already set up your repository, you don’t need to perform this step.

To set up the repository, go to EDB repositories and follow the instructions provided there.

Install the package#

The syntax for the install command is:

sudo <package-manager> -y install edb-<postgres><postgres_version>-server-sqlprofiler

Where:

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

Package manager

Operating system

dnf

RHEL 8 and derivatives

zypper

SLES

apt-get

Debian and derivatives

  • <postgres> is the distribution of Postgres you’re using:

Postgres distribution

Value

PostgreSQL

pg

EDB Postgres Advanced Server

as

EDB Postgres Extended

postgresextended

  • <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

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
  1. Restart the Postgres server.

  2. 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.