pgNow

Enabling pg_stat_statements on Amazon RDS and Aurora PostgreSQL

To enable pg_stat_statements on Amazon RDS for PostgreSQL, follow these steps:

  1. Modify the Parameter Group:

    • Go to the Amazon RDS console.
    • Select Parameter groups from the navigation pane.
    • Choose the parameter group associated with your RDS instance or create a new one.
    • Set the shared_preload_libraries parameter to include pg_stat_statements.
  2. Apply the Parameter Group:

    • If you created a new parameter group, associate it with your RDS instance.
    • Go to Databases in the RDS console.
    • Select your RDS instance, choose Modify, and change the parameter group to the one you just modified.
    • Save the changes and reboot the RDS instance for the new parameter group to take effect.
  3. Create the Extension:

    • Connect to your PostgreSQL database using a client like psql.
    • Run the following SQL command to create the extension:
      CREATE EXTENSION pg_stat_statements;
      

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


Didn't find what you were looking for?