Hello,
Any one can help me for my problem on postgresql using pmm-admin,
I got the error log,
2021-01-11 13:25:00.013 WIB [19845] pmm@postgres ERROR: relation "pg_stat_statements" does not exist at character 753
2021-01-11 13:25:00.013 WIB [19845] pmm@postgres STATEMENT: SELECT /* pmm-agent:pgstatstatements */ "pg_stat_statements"."userid", "pg_stat_statements"."dbid", "pg_stat_statements"."queryid", "pg_stat_statements"."query", "pg_stat_statements"."calls", "pg_stat_statements"."total_time", "pg_stat_statements"."rows", "pg_stat_statements"."shared_blks_hit", "pg_stat_statements"."shared_blks_read", "pg_stat_statements"."shared_blks_dirtied", "pg_stat_statements"."shared_blks_written", "pg_stat_statements"."local_blks_hit", "pg_stat_statements"."local_blks_read", "pg_stat_statements"."local_blks_dirtied", "pg_stat_statements"."local_blks_written", "pg_stat_statements"."temp_blks_read", "pg_stat_statements"."temp_blks_written", "pg_stat_statements"."blk_read_time", "pg_stat_statements"."blk_write_time" FROM "pg_stat_statements" WHERE queryid IS NOT NULL AND query IS NOT NULL
then is my pmm-admin version
root@webfarmcli:/var/log/postgresql# pmm-admin --version
ProjectName: pmm-admin
Version: 2.13.0
PMMVersion: 2.13.0
Timestamp: 2020-12-29 11:01:24 (UTC)
FullCommit: d59c04db689ae0bc7eff55b7bd717a54a63ad550
root@webfarmcli:/var/log/postgresql#
and then i cek on my postgresql console,
root=# SELECT *
root-# FROM pg_available_extensions
root-# WHERE
root-# name = 'pg_stat_statements' and
root-# installed_version is not null;
name | default_version | installed_version | comment
--------------------+-----------------+-------------------+-----------------------------------------------------------
pg_stat_statements | 1.6 | 1.6 | track execution statistics of all SQL statements executed
(1 row)
root=#
root=# SHOW shared_preload_libraries;
shared_preload_libraries
--------------------------
pg_stat_statements
(1 row)
root=#
root=# SELECT * FROM pg_stat_statements limit 1;
userid | dbid | queryid | query | calls | total_time | min_time | max_time | mean_time | stddev_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | blk_read_time | blk_write_time
--------+-------+------------+------------------------------------------------------------------------------------------------------------+-------+------------+----------+----------+-----------+--------------------+------+-----------------+------------------+---------------------+---------------------+----------------+-----------------+--------------------+--------------------+----------------+-------------------+---------------+----------------
17187 | 13018 | 1727914665 | SELECT +| 9 | 3.586581 | 0.350757 | 0.460403 | 0.398509 | 0.0369535392441193 | 324 | 24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
| | | pg_database.datname, +| | | | | | | | | | | | | | | | | | |
| | | tmp.state, +| | | | | | | | | | | | | | | | | | |
| | | COALESCE(count,$1) as count, +| | | | | | | | | | | | | | | | | | |
| | | COALESCE(max_tx_duration,$2) as max_tx_duration +| | | | | | | | | | | | | | | | | | |
| | | FROM +| | | | | | | | | | | | | | | | | | |
| | | ( +| | | | | | | | | | | | | | | | | | |
| | | VALUES ($3), +| | | | | | | | | | | | | | | | | | |
| | | ($4), +| | | | | | | | | | | | | | | | | | |
| | | ($5), +| | | | | | | | | | | | | | | | | | |
:
Fyi, i used postgresql 9.5 and 10 version.
Any idea?