Skip to content
Commits on Source (3)
icinga2 (2.6.0-2+deb9u1) UNRELEASED; urgency=medium
* [0eb3cad] Fix timestamps being stored as local time in PostgreSQL.
-- Felix Geyer <felix.geyer@credativ.de> Tue, 01 May 2018 22:01:29 +0200
icinga2 (2.6.0-2) unstable; urgency=medium
* [e0f34e4] Add patch 41_ido_mysql57 - for compatibility with MySQL 5.7
......
From e9db716b26e49a36d733d5e224280fb63943fb9f Mon Sep 17 00:00:00 2001
From: Michael Friedrich <michael.friedrich@netways.de>
Date: Wed, 11 Jan 2017 17:34:09 +0100
Subject: [PATCH] Ensure that PostgreSQL timestamps are UTC
fixes #13617
---
lib/db_ido_pgsql/idopgsqlconnection.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp
index f398fda50..c16f9f50f 100644
--- a/lib/db_ido_pgsql/idopgsqlconnection.cpp
+++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp
@@ -636,7 +636,7 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
} else if (DbValue::IsTimestamp(value)) {
long ts = rawvalue;
std::ostringstream msgbuf;
- msgbuf << "TO_TIMESTAMP(" << ts << ")";
+ msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
*result = Value(msgbuf.str());
} else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()";
21_config_changes
41_ido_mysql57
42_mips_boost_bind_workaround
43_postgres_timezone