Amazon RDS: Resolving the "pg_stat_statements must be loaded via shared_preload_libraries" error

You may get the following error when you setup pganalyze, which collects query performance information using pg_stat_statements:

ERROR: pg_stat_statements must be loaded via shared_preload_libraries

This error indicates that you have not fully enabled pg_stat_statements in your database yet. To enable it for a database running on Amazon RDS, go to your AWS Console, modify your existing custom DB Parameter Group, or create a new custom DB Parameter Group:

rds parameter group

In the custom parameter group, modify the shared_preload_libraries setting and make sure it includes pg_stat_statements.

In case you created a new parameter group you'll have to modify your database to use this new parameter group:

rds enable parameter group

To apply the configuration change you will need to reboot your database.

Then re-run SELECT * FROM pg_stat_statements LIMIT 1 and make sure you get a result.


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →