Submitting forms on the support site are temporary unavailable for schedule maintenance. If you need immediate assistance please contact technical support. We apologize for the inconvenience.
ERROR: column "total_exec_time" does not exist in PostgreSQL agent log file
설명
Top SQL statements are not collected for a PostgreSQL agent even though the pg_stat_statements extension has been installed.
원인
After upgrading to PostgreSQL 13 or higher and enabling pg_stat_statements, the column in pg_stat_statements is renamed from "total_time" to "total_exec_time" as columns were added for planning times as well as execution times.
A PG_STAT_STATEMENTS extension created in the database at a lower version may still be missing the column total_exec_time.
해결 방안
Verify that the pg_stat_statements extension has the column total_exec_time.
SELECT
column_name,
data_type,
character_maximum_length,
is_nullable,
column_default
FROM
information_schema.columns
WHERE
table_name = 'pg_stat_statements';
If the column is not present, then delete the extension
DROP EXTENSION pg_stat_statements;.
and then recreate the extension as per Resolution 1 in knowledgebase article 4226972