0

我对 postgresql 时区有点困惑 我正在检查某些行中的日期,我注意到其中的时区 -4 但我的实际时区是 -3 政府对夏令时时区和 tzdata 文件进行了更改系统日期很好,但 postgres 直到我重新启动它才注意到更改

我尝试使用 set TIME ZONE LOCAL 设置它,但它仍然得到了错误的时区 -4

select extract(epoch from now()),now();
date_part     |             now              
------------------+------------------------------
 1335240339.68894 | 2012-04-24 00:05:39.68894-04
(1 fila)

但是在我重新启动postgresql之后

# select extract(epoch from now()),now();

日期部分 | 现在
----------------+--------------------------------

  1335240403.672 | 2012-04-24 01:06:43.672002-03
 (1 fila)

我的时区总是

 show timezone;
     TimeZone     
------------------
 America/Santiago
(1 fila)

每次更改 tzdata 信息时,我是否需要重新启动 postgres?

4

1 回答 1

5

According to this FAQ entry, PostgreSQL is coming with the latest tzdata database. In order to keep it up to date, one should install minor PostgreSQL releases on a regular basis.

It is also possible to have PostgreSQL compiled with system tzdata database support using the --with-system-tzdata configure option.

In both cases, running server will not monitor for changes in the tzdata databases, so you'll have to explicitly notify it via the restart.

于 2012-04-24T06:08:41.720 回答