Skip to content

Commit d81d1ae

Browse files
committed
Use start transaction timestamp instead of clock
Looks like an oversight from #2221 when CAgg refresh policies were introduced. The idea of the function `subtract_interval_from_now` is to calculate timestamp for offset intervals for policy checks and make no sense get the clock timestamp instead of the start transaction. So changed the `GetCurrentTimestamp()` (aka `clock_timestamp()`) to `GetCurrentTransactionStartTimestamp` (aka `now()`).
1 parent c821594 commit d81d1ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tsl/src/bgw_policy/policy_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ subtract_interval_from_now(Interval *lag, Oid time_dim_type)
2222
#ifdef TS_DEBUG
2323
Datum res = ts_get_mock_time_or_current_time();
2424
#else
25-
Datum res = TimestampTzGetDatum(GetCurrentTimestamp());
25+
Datum res = TimestampTzGetDatum(GetCurrentTransactionStartTimestamp());
2626
#endif
2727

2828
switch (time_dim_type)

0 commit comments

Comments
 (0)