Merge pull request #6622 from Icinga/bugfix/ido-pgsql-cleanup-timestamp-utc

Ensure to use UTC timestamps for IDO PgSQL cleanup queries
This commit is contained in:
Michael Friedrich 2018-09-17 11:20:49 +02:00 committed by GitHub
commit eee4426dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -945,7 +945,7 @@ void IdoPgsqlConnection::InternalCleanUpExecuteQuery(const String& table, const
Query("DELETE FROM " + GetTablePrefix() + table + " WHERE instance_id = " +
Convert::ToString(static_cast<long>(m_InstanceID)) + " AND " + time_column +
" < TO_TIMESTAMP(" + Convert::ToString(static_cast<long>(max_age)) + ")");
" < TO_TIMESTAMP(" + Convert::ToString(static_cast<long>(max_age)) + ") AT TIME ZONE 'UTC'");
}
void IdoPgsqlConnection::FillIDCache(const DbType::Ptr& type)