No statements populated on the PostgreSQL statements dashboard data for PostgreSQL.
Error messages like "ERROR: relation "pg_stat_statements" does not exist" may appear in the PostgreSQL agent log file.
RESOLUTION 1
Installation of the pg_stat_statements module and creation of the extension in a database is required for statement tracking. Basic steps follow below. For more information on how to install this, refer to the relevant PostgreSQL documentation for your version
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.max = 1000
pg_stat_statements.track = all
More info on properties: https://www.postgresql.org/docs/current/static/pgstatstatements.html
CREATE EXTENSION pg_stat_statements;
If the view is present and the statements do not display, try recreating the view in the database and ensure that the Foglight user has access to the view.
GRANT pg_monitor TO USERNAME;
GRANT pg_read_all_settings TO USERNAME;
GRANT pg_read_all_stats TO USERNAME;
GRANT pg_stat_scan_tables TO USERNAME;
If the user still cannot find pg_stat_statements, then check which schema the extension was created in. Usually it is installed in the pg_catalog schema.
SELECT extname, extnamespace::regnamespace AS schema_nameFROM pg_extensionWHERE extname = 'pg_stat_statements';
Next, check that the same schema is included user's search path
SHOW search_path;ALTER ROLE USERNAME SET search_path = USERNAME, public;
RESOLUTION 2
Run the following command in each database where pg_stat_statements has been installed.
ALTER EXTENSION pg_stat_statements UPDATE