谁负责保持 pg_timezone_names 视图更新?

Who is in charge of keep pg_timezone_names view updated?

2007 年,我们的总统将它从 UTC−04:00 更改为 UTC−04:30,因为 children 上学早。现在 2016 年决定晚上很早到达并恢复 UTC−04:00 以节省电力。

那么您如何保持 table pg_timezone_names 更新?有没有我可以使用的脚本,我可以 link 到我的服务器的服务?

或者每次我听到有变化时都必须自己更新 table?

编辑: 我刚刚意识到 pg_timezone_names 是一个视图而不是 table。那么现在的附加问题是我如何更新视图?

第二次编辑:我正在使用 windows 服务器 2008 和 postgres 9.3

您提到的针对委内瑞拉的更改已在 tz database. You can read the 2016d release notes here 的 2016d 版中处理。

Postgres 将这些更新编译到每个发布版本的 postgres 中。可以看到Postgres时区版本历史here。从这些信息可以看出,2016-05-06,2016d的数据被添加到Postgres源码中。这意味着在此之后发布的任何版本的 Postgres 都应该有相关的时区更改。

the Postgres home page, in the upper-right corner, you can see the latest release versions. If you wish to stay on 9.3, then update to the latest build which is 9.3.13, released 2016-05-12. Indeed, in the release notes for 9.3.13 上,它提到了这个:

  • Update time zone data files to tzdata release 2016d for DST law changes in Russia and Venezuela. ...

请注意,Postgres 提供了一个选项 --with-system-tzdata=DIRECTORY,您可以使用该选项使用 OS tzdata 更新来保持最新状态,但是它希望找到 zic 编译的 tzdata,例如随 [=38= 分发的]、OSX 等。此格式的数据在 Windows 上不可用。因此,您必须使用 Postgres 附带的 tzdata。

So how you keep the table pg_timezone_names updated? is there a script I can use, a service I can link to my server?

不,在 Windows 上没有自动执行此操作的方法(据我所知)。您必须与当前版本的 Postgres 保持同步。在 Linux,您可以自动更新 tzdata 并使用我之前提到的选项标志。

Or just have to update the table myself ...

请勿尝试手动操作时区数据。它比您想象的要复杂得多。

... everytime I heard something change?

如果您想了解时区数据更新,请订阅 tz 公告邮件列表 at IANA

您也可以考虑订阅 Postgres's RSS feed. Do also keep in mind Postgres's support lifecycle,因为次要更新最终会结束,您必须进行更实质性的升级才能保持最新状态。