From 04a508ad99a3a3a7b5c464adfda32d01afd329e0 Mon Sep 17 00:00:00 2001 From: Keiko Oda Date: Fri, 10 Nov 2023 16:59:07 +0900 Subject: [PATCH] Add a special error message when Postgres 14+ is using the older version pg_stat_statements --- input/postgres/statements.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/input/postgres/statements.go b/input/postgres/statements.go index 558a0ab15..72e86d2ec 100644 --- a/input/postgres/statements.go +++ b/input/postgres/statements.go @@ -141,6 +141,10 @@ func GetStatements(ctx context.Context, server *state.Server, logger *util.Logge if globalCollectionOpts.TestRun && foundExtMinorVersion < extMinorVersion { logger.PrintInfo("pg_stat_statements extension outdated (1.%d installed, 1.%d available). To update run `ALTER EXTENSION pg_stat_statements UPDATE`", foundExtMinorVersion, extMinorVersion) + if extMinorVersion >= 9 { + // with Postgres 14+, there is a known data issue if pgss is using the older version + logger.PrintError("Outdated pg_stat_statements extension is known to cause the incorrect data with query statistics") + } } usingStatsHelper := false