pgNow

Enabling pg_stat_statements on Azure Flex server

To enable pg_stat_statements on an Azure Database for PostgreSQL Flexible Server, follow these steps:

  1. Azure Portal:

    • Go to the Azure Database for PostgreSQL Flexible Server resource management page.
    • Select the Server Parameters blade.
    • Find the pg_stat_statements.track parameter and set its value to TOP or ALL depending on your needs.
  2. Azure CLI:

    • Use the following command to set the parameter:
      az postgres flexible-server parameter set \
        --resource-group <your-resource-group> \
        --server-name <your-server-name> \
        --name pg_stat_statements.track \
        --value TOP
      
  3. Restart the Server:

    • After setting the parameter, you may need to restart the server for the changes to take effect.

This will enable the pg_stat_statements extension, allowing you to track execution statistics for all SQL statements executed by the server


Didn't find what you were looking for?