How it works...

In our opinion, the first set of instructions should not be required. The pg_stat_statements module is so valuable that we feel everyone can benefit from its contents. In any case, the first thing we must do is add pg_stat_statements to the shared_preload_libraries configuration setting. Several PostgreSQL modules are only available after being added this way.

The next step is only necessary if we are running a version older than PostgreSQL 9.2. The custom_variable_classes setting allows us to further configure the pg_stat_statements module later. Current versions of PostgreSQL will handle this for us.

As the pg_stat_statements module depends on activating an external library, we must restart PostgreSQL for it to take effect. ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.