Does pg_stat_statements extension view needs to be created on all databases

Hello,

Does the extension needs to be created on each database separately for the QAN to capture the sqls ?

##Reference:

  1. Install the extension.
psql postgres postgres -c "CREATE EXTENSION pg_stat_statements SCHEMA public"

This command creates the view where you can access the collected statistics.

We recommend that you create the extension for the postgres database. In this case, you receive access to the statistics collected from every database.

Hello, no, only for postgres database.

Thank you nurlan for responding.
Just confirming , I am unable to query pg_stat_statements view from other dbs since i executed create extension only for postgres db, but as you said this should work fine.
We dont need to run this individually on each database.

@rups , also please consider using pg_stat_monitor - pg_stat_monitor Documentation extension as it will provide much better data
PostgreSQL - Percona Monitoring and Management

Sure, pls suggest how to install pg_stat_monitor on freebsd. We have database cluster with rhel and freebsd.