【问题标题】:begin postgresql 9.2 default timezone开始 postgresql 9.2 默认时区
【发布时间】:2014-01-23 08:37:40
【问题描述】:

大家

发现开始postgresql 9.2;安装postgresql时,postgresql时区是GMT;之前 9.2 和 9.1.6 一样,postgresql 时区由系统时区设置

例如

9.1.6

postgres(at)postgres 2014-01-23_16:34:30 ([local]:5432)  # select now();
+-------------------------------+
|              now              |
+-------------------------------+
| 2014-01-23 16:34:33.817441+08 |
+-------------------------------+
(1 row)

Time: 13.034 ms

| TimeZone                        | PRC        

9.2.4

postgres=# select now();
              now              
-------------------------------
 2014-01-23 08:35:27.509442+00
(1 row)

 TimeZone                        | GMT                 

所以,在 postgresql 9.1 之后,像 9.2 一样应该在 postgresql 数据目录 postgresql.conf 中设置 postgresql 时区??

谢谢

【问题讨论】:

    标签: postgresql timezone


    【解决方案1】:

    在 9.2 之前,postgresql 会在启动时探测系统时区。这显然是一项昂贵的检查,因此请注意在执行 initdb 时会对其进行探测,并在 postgresql.conf 中设置初始值。如果您从 postgresql.conf 中删除该设置,它将默认为 GMT。

    如果您的服务器默认为 GMT,则升级时探测过程无法正常工作,或者您可能不小心覆盖了 conf 文件中的值。

    请参阅:Timezonerelease notes(搜索时区)。

    【讨论】:

      猜你喜欢
      • 2014-10-06
      • 1970-01-01
      • 2018-01-06
      • 1970-01-01
      • 1970-01-01
      • 2013-08-29
      • 2019-05-13
      • 2011-04-30
      相关资源
      最近更新 更多