The SQL Profiler plugin is not automatically enabled when the installation process completes. This allows you to restart the server at a convenient time, and prevents the plugin from being loaded unnecessarily on systems where it is not required on a continual basis.
1. Edit the postgresql.conf file on the server you wish to profile, modifying the shared_preload_libraries parameter as shown below:
3. Using the Query Tool in the PEM client or the psql command line interface, run the sql-profiler.sql script in the database specified as the Maintenance Database on the server you wish to profile. If you are using:
• To use the PEM Query Tool to run the script, highlight the name of the maintenance database in the PEM Client tree control, and navigate through the Tools menu to select Query tool. When the Query Tool opens, use the Open option on the Files menu to open a web browser and navigate to the sql-profiler.sql script. By default, the sql-profiler.sql script is located under your Postgres installation directory in share/postgresql/contrib/.When the script opens in the SQL Editor panel of the Query Tool, highlight the content of the script in the SQL Editor and select the Execute option from the Query menu (or click the Execute icon) to invoke the script and configure SQL Profiler.You can also use the psql command line to invoke the configuration script. The following command invokes the sql-profiler.sql script using the psql command line tool on a Linux system:$ /opt/PostgreSQL/9.5/bin/psql -U postgres postgres <
/opt/PostgreSQL/9.5/share/postgresql/contrib/sql-profiler.sqlTo open SQL Profiler with the PEM client, highlight the name of a server you wish to profile in the tree control, and select SQL Profiler from the Management menu. The SQL Profiler wizard (shown in Figure 5.7), opens.