Getting ready

Find the pgstatslog directory in the set of files distributed along with this book.

Find out the directory to place shared files using pg_config --sharedir and then copy the files to the extension subdirectory of that directory.

Now that the extension has been installed in your PostgreSQL server, it is time to install it in each database that you want to monitor:

postgres=# CREATE EXTENSION pgstatslog;
CREATE EXTENSION

You can verify that the extension is installed by typing \dx in psql.