Postgres: Fix time group macro when TimescaleDB is enabled and interval is less than a second (#33153) (#33219)

Fixing a special case with time group macro when
using TimescaleDB and interval is lower than a second.

Fixes #33124

(cherry picked from commit dd0ba96d7c)
This commit is contained in:
Marcus Efraimsson
2021-04-21 16:55:59 +02:00
committed by GitHub
parent 051994d758
commit 2b0cc8c9b4
2 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ func (m *postgresMacroEngine) evaluateMacro(name string, args []string) (string,
}
if m.timescaledb {
return fmt.Sprintf("time_bucket('%.0fs',%s)", interval.Seconds(), args[0]), nil
return fmt.Sprintf("time_bucket('%.1fs',%s)", interval.Seconds(), args[0]), nil
}
return fmt.Sprintf(