]> granicus.if.org Git - icinga2/commitdiff
Ensure to use UTC timestamps for IDO PgSQL cleanup queries 6622/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Mon, 17 Sep 2018 07:51:20 +0000 (09:51 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 17 Sep 2018 09:06:54 +0000 (11:06 +0200)
refs #6584

lib/db_ido_pgsql/idopgsqlconnection.cpp

index 9771d4027fbf3577fd81e52fabaa9c3e95a852a5..16e0b567de78796d97fc708930e32257438daf91 100644 (file)
@@ -947,7 +947,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)