Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[dev.icinga.com #2203] pgsql unix_timestamp cannot handle timstamp with timezone #825
This issue has been migrated from Redmine: https://dev.icinga.com/issues/2203
Created by mfriedrich on 2011-12-16 08:43:57 +00:00
the function unix_timestamp is self written and does not respect the timezone, therefore creating an error.
below is the look before, and after applying 1.6.0 upgrade, failing on the query.
2012-04-19 14:05:30 +00:00 by mfriedrich d179dea
Updated by mfriedrich on 2011-12-16 09:29:00 +00:00
working query, respecting timezones
Updated by mfriedrich on 2011-12-16 11:24:28 +00:00
ok, this is happening with enable_sla=1 in ido2db.cfg
Updated by mfriedrich on 2011-12-16 11:43:35 +00:00
this affects from_unixtime too.
by default, to_timestamp will return timestamp with time zone, but as a matter of fact we cast that to ::timezone removing the time zone awareness of this function.
so timestamps passed as utc will not be saved correctly within their given timezone, but default anyways.
since from_unixtime is being used within the most queries, the function must remain. changing a return type will require the function to be dropped and then created again instead if replacing it.
in current +1 timezone.
get onto utc
so currently timestamps are not timezone aware as they should be. depends on general discussion how and when to fix this.
Updated by mfriedrich on 2011-12-16 12:59:18 +00:00
Updated by mfriedrich on 2012-04-19 13:58:48 +00:00
Updated by Tommi on 2012-04-26 19:24:57 +00:00
I am sorry, but currently i have only mysql and oracle available. In general it should follow the logic we introduced for the tables timestamp values. There i did the same tests. When connecting set session timezone=UTC' will be executed. Therefore all incoming data should be in UTC, which is also expected from the other databases.