Turkey Continues on Daylight Saving Time From 2016

2019-09-16 09:18发布

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

2条回答
走好不送
2楼-- · 2019-09-16 09:53

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.

查看更多
乱世女痞
3楼-- · 2019-09-16 09:56

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.

查看更多
登录 后发表回答