In order to set up Statement monitoring in the PostgreSQL agent monitoring Azure Database for PostgreSQL you'll need to first follow these steps to enable the pg_stat_statements extension for collecting query statistics.
A message similar to the following may appear in PostgreSQL if the extension has not been allow listed in Azure.
extension "pg_stat_statements" is not allow-listed for "azure_pg_admin" users in Azure Database for PostgreSQL
Note that this will reboot your database if pg_stat_statements has not been enabled before.
Select your Azure Database for PostgreSQL flexible server instance.
From the resource menu, under Settings section, select Server parameters.
Include the libraries you wish to add in the value of shared_preload_libraries
, and select Save.
shared_preload_libraries
is a static server parameter, it requires a server restart so that the changes take effect.
After an extension is allowlisted and, if the extension requires it, is also added to shared_load_libraries
, it can be created or installed in each database on which it's to be used.
Connect to your database as a user with azure_pg_admin privileges (usually the credentials you created the database with), e.g. using psql.
Run the CREATE EXTENSION command to create or install a particular extension. This command loads the packaged objects into your database.CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
SELECT * FROM pg_stat_statements LIMIT 1;
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. 이용 약관 개인정보 보호정책 Cookie Preference Center