Turkey Continues on Daylight Saving Time From 2016 - Impact on Postgresql

こ雲淡風輕ζ 提交于 2019-12-12 03:09:52

问题


what is impact on Postgresql databases? Jobs ,date columns datas will be affected?


回答1:


postgresql uses the zoneinfo database for time zone computations. The database's 2016g version which was released 2 weeks ago, includes an update to handle the situation for Turkey correctly. For now, you'll have to wait for the postgresql developers to pull the latest version of zoneinfo into postgresql and then release a new version. You can check what postgres thinks for Turkey's timezone as follows:

$ SET TIME ZONE 'Asia/Istanbul';
$ SELECT extract(timezone FROM '2016-06-01'::timestamptz), extract(timezone FROM '2016-12-01'::timestamptz);
 date_part | date_part 
-----------+-----------
     10800 |      7200
(1 row)

As you can see, on my system (postgresql 9.5.4), it still thinks that Turkey will switch to +2 offset in the winter.




回答2:


As soon as this change hits the IANA timezone library, it will be included in PostgreSQL with the next minor release. This has happened with commit a03339aef2, so the change will be in 9.6.1, 9.5.5, 9.4.10, 9.3.15, 9.2.19 and 9.1.24.

Data of type timestamp with time zone will not be affected, as they are stored in UTC internally. If your client time zone is set to Turkey or equivalent, the data will be displayed with the (new) correct time zone offset.

Data of type timestamp without time zone will stay the same, so they will not be automatically shifted to the new time zone offset upon display. But it's almost always a mistake to use that data type anyway.



来源:https://stackoverflow.com/questions/39700628/turkey-continues-on-daylight-saving-time-from-2016-impact-on-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!