Skip to content

Commit

Permalink
fix: check if pgpro_stats was installed
Browse files Browse the repository at this point in the history
  • Loading branch information
mstyushin committed Jan 14, 2025
1 parent f9e8623 commit 63d7e4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mamonsu/plugins/pgsql/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def run(self, zbx):
# TODO: add 13 and 14 items when pgpro_stats added new WAL metrics
all_items = self.Items.copy()

if Pooler.extension_version_greater("pgpro_stats", "1.8"):
if Pooler.extension_installed("pgpro_stats") and Pooler.extension_version_greater("pgpro_stats", "1.8"):
info_view = 'pg_stat_statements_info'
if self.extension == "pgpro_stats":
info_view = 'pgpro_stats_info'
Expand Down
2 changes: 1 addition & 1 deletion mamonsu/tools/bootstrap/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def run_deploy():
if Pooler.is_pgpro() or Pooler.is_pgpro_ee():
bootstrap_extension_queries = fill_query_params(CreateWaitSamplingFunctionsSQL)
Pooler.query(bootstrap_extension_queries)
if Pooler.extension_version_greater("pgpro_stats", "1.8"):
if Pooler.extension_installed("pgpro_stats") and Pooler.extension_version_greater("pgpro_stats", "1.8"):
statements_items = [x[1] for x in Statements.Items_pgpro_stats_1_8] + [x[1] for x in Statements.Items_pg_13]
statements_columns = [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pgpro_stats_1_8] + [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pg_13]
bootstrap_extension_queries = CreateStatementsFunctionsSQL.format(
Expand Down

0 comments on commit 63d7e4a

Please sign in to comment.