Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a special error message during test run when Postgres 14+ is using the older pgss #472

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions input/postgres/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ 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 {
// Using the older version pgss with Postgres 14+ can cause the incorrect query stats
// when track = all is used + there are toplevel queries and nested queries
// https://github.com/pganalyze/collector/pull/472#discussion_r1399976152
logger.PrintError("Outdated pg_stat_statements may cause incorrect query statistics")
}
}

usingStatsHelper := false
Expand Down
Loading