fix: audit log query when Postgres TZ isn't UTC (#6067)

This commit is contained in:
Colin Adler
2023-02-06 21:36:39 +00:00
committed by GitHub
parent d9e22d74ba
commit b81d8464df
3 changed files with 7 additions and 16 deletions
+2 -2
View File
@@ -462,13 +462,13 @@ WHERE
END
-- Filter by date_from
AND CASE
WHEN $9 :: timestamp with time zone != '0001-01-01 00:00:00' THEN
WHEN $9 :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
"time" >= $9
ELSE true
END
-- Filter by date_to
AND CASE
WHEN $10 :: timestamp with time zone != '0001-01-01 00:00:00' THEN
WHEN $10 :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
"time" <= $10
ELSE true
END
+2 -2
View File
@@ -76,13 +76,13 @@ WHERE
END
-- Filter by date_from
AND CASE
WHEN @date_from :: timestamp with time zone != '0001-01-01 00:00:00' THEN
WHEN @date_from :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
"time" >= @date_from
ELSE true
END
-- Filter by date_to
AND CASE
WHEN @date_to :: timestamp with time zone != '0001-01-01 00:00:00' THEN
WHEN @date_to :: timestamp with time zone != '0001-01-01 00:00:00Z' THEN
"time" <= @date_to
ELSE true
END