Skip to content

Commit

Permalink
fix: Fix pg_stat_archiver on pg13- (#235)
Browse files Browse the repository at this point in the history
On older postgres version the existing cast to numeric isn't enough to
guarantee that the result expression is numeric too, so explicitly cast the
resulting expression to numeric to make sure that we can round the result.
  • Loading branch information
rjuju authored Nov 22, 2024
1 parent f1cbdb9 commit 49472af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion powa/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,11 @@ class GlobalArchiverMetricGroup(MetricGroupDef):
@property
def query(self):
query = powa_get_archiver_sample()
ts = get_ts()

cols = [
"extract(epoch FROM ts) AS ts",
"round(nb_arch::numeric / " + get_ts() + ", 2) AS nb_arch",
"round((nb_arch::numeric / " + ts + ")::numeric, 2) AS nb_arch",
"nb_to_arch",
]

Expand Down

0 comments on commit 49472af

Please sign in to comment.