Thread: collector's time is wrong.(year 2038 problem)
<div class="WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Dear PostgreSQL Developers.</span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US"style="font-size:10.0pt">This problem occurs at ver. 9.3 or later.</span><p class="MsoNormal"><span lang="EN-US"style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Test environment</span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Windows 7 Ultimate (64bit)</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt">Language:Japanese</span><p class="MsoNormal"><span lang="EN-US"style="font-size:10.0pt">PostgreSQL 9.3.6 and 9.6.1</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt"> </span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Windows 8 Embedded (64bit).</span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Language:English</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt">PostgreSQL 9.3.5</span><p class="MsoNormal"><span lang="EN-US"style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Steps</span><pclass="MsoListParagraph" style="margin-left:18.0pt;mso-para-margin-left:0gd;text-indent:-18.0pt;mso-list:l1level1 lfo1"><span lang="EN-US" style="font-size:10.0pt"><spanstyle="mso-list:Ignore">1.<span style="font:7.0pt "Times New Roman""> </span></span></span><spanlang="EN-US" style="font-size:10.0pt">Change current time. (e.g. Sep. 1st 2040)</span><p class="MsoListParagraph"style="margin-left:18.0pt;mso-para-margin-left:0gd;text-indent:-18.0pt;mso-list:l1 level1 lfo1"><spanlang="EN-US" style="font-size:10.0pt"><span style="mso-list:Ignore">2.<span style="font:7.0pt "Times New Roman""> </span></span></span><span lang="EN-US" style="font-size:10.0pt">Start PostgreSQL Service.</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Ifsomeone change the current time after than January 9th 2038.</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt">pgstat_recv_inquiry() method was wrong behavior, because GetCurrentTimestamp()returned wrong timestamp.</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Couldyou see following logs.(Winows7 x64 PostgreSQL ver.9.6.1)</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">2040-11-0114:32:29 JST LOG: database system was shut down at 2016-11-01 14:29:15 JST</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt">2040-11-01 14:32:29 JST LOG: MultiXact member wraparound protectionsare now enabled</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">2040-11-01 14:32:29 JSTLOG: database system is ready to accept connections</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">2040-11-0114:32:29 JST LOG: autovacuum launcher started</span><p class="MsoNormal"><span lang="EN-US"style="font-size:10.0pt">2040-11-01 14:32:29 JST LOG: stats_timestamp 2016-11-01 14:29:15.049209+09 is laterthan collector's time 1904-09-26 08:04:13.934251+09 for database 0</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">2040-11-0114:33:30 JST LOG: stats collector's time 2016-11-01 14:29:15.049209+09 is later thanbackend local time 1904-09-26 08:05:14.025556+09</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">2040-11-0114:33:30 JST LOG: stats_timestamp 2016-11-01 14:29:15.049209+09 is later than collector'stime 1904-09-26 08:05:14.025556+09 for database 12401</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt"> </span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">And I don't know whetherthis causes, but the state of the PostgreSQL service in the Service Manager won't be "starting".</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt">Could you investigating these problem.</span><p class="MsoNormal"><spanlang="EN-US" style="font-size:10.0pt"> </span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">bestregards.</span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">/*</span><spanlang="EN-US">------------------------------------------------</span><span lang="EN-US"style="font-size:10.0pt"></span><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"MSゴシック"">Kazuki Ishihara</span><span lang="EN-US" style="font-size:10.0pt"></span><pclass="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Mail: <a href="mailto:Kazuki.Ishihara@keisetsu.jp"><spanstyle="color:blue">Kazuki.Ishihara@keisetsu.jp</span></a></span><p class="MsoNormal"><spanlang="EN-US">------------------------------------------------</span><span lang="EN-US" style="font-size:10.0pt">*/</span><spanlang="EN-US"></span><p class="MsoNormal"><span lang="EN-US"> </span></div>
=3D?iso-2022-jp?B?GyRCQFA4NhsoQiAbJEJPQjx5GyhC?=3D <Kazuki.Ishihara@keiset= su.jp> writes: > 1. Change current time. (e.g. Sep. 1st 2040) > 2. Start PostgreSQL Service. This is not going to work on any platform that uses 32-bit time_t. It's not our bug, it's that the system time API doesn't work after 2038. The short answer is that you're not going to still be using Windows 8 in 2040, so don't worry about it. regards, tom lane