When using an enterprise version in Oracle such as databases, we see historic information such as what query ran through what user at a certain point in time, through some views. Such views may help in identifying the queries that ran some time ago and their overall statistics, such as the total number of times the query ran and the average time consumption. Such information can be visible in PostgreSQL using an extension called pg_stat_statements. In this recipe, we shall discuss how pgBadger can be configured as an extension.
Getting ready
In order to configure this extension, we must have a PostgreSQL server that has the contrib module installed. This extension is part of the contrib module and does not involve any complex procedure to install and configure. So, all it requires is the postgresql-contrib-13 package on Ubuntu or the postgresql13-contrib package on CentOS/Red Hat to install this extension.
How to do it...
We will configure...