Remove pg_stat_monitor¶
To uninstall pg_stat_monitor, do the following:
-
Disable statistics collection. Establish the
psqlsession and run the following command :ALTER SYSTEM SET pg_stat_monitor.track = none; -
Drop
pg_stat_monitorextension:DROP EXTENSION pg_stat_monitor; -
Remove
pg_stat_monitorfrom theshared_preload_librariesconfiguration parameter:ALTER SYSTEM SET shared_preload_libraries = '';Important
If the
shared_preload_librariesparameter includes other modules, specify them all for theALTER SYSTEM SETcommand to keep using them. -
Restart the
postgresqlinstance to apply the changes. The following command restarts PostgreSQL 15. Replace the version value with the one you are using.- On Debian and Ubuntu:
$ sudo systemctl restart postgresql.service- On Red Hat Enterprise Linux and CentOS:
$ sudo systemctl restart postgresql-15