diff --git a/server/src-lib/Hasura/Backends/Postgres/DDL/EventTrigger.hs b/server/src-lib/Hasura/Backends/Postgres/DDL/EventTrigger.hs index bd479b2e211..ead155ca0f5 100644 --- a/server/src-lib/Hasura/Backends/Postgres/DDL/EventTrigger.hs +++ b/server/src-lib/Hasura/Backends/Postgres/DDL/EventTrigger.hs @@ -1058,7 +1058,7 @@ deleteEventTriggerLogsTx TriggerLogCleanupConfig {..} = do [ST.st| SELECT id FROM hdb_catalog.event_log WHERE ((delivered = true OR error = true) AND trigger_name = $1) - AND created_at < now() - interval '#{qRetentionPeriod}' + AND created_at < (now() - interval '#{qRetentionPeriod}') AT TIME ZONE 'UTC' AND locked IS NULL LIMIT $2 |]