开发者

PostgreSQL x Windows Auto Adjust Clock for DST

开发者 https://www.devze.com 2023-02-08 03:53 出处:网络
I have PostgreSQL installed in several customers (always in Windows). I\'m facing some situation with current_timestamp, wich depending of \"Windows Auto Adjust DST\", is returning \"wrong\" time, ev

I have PostgreSQL installed in several customers (always in Windows).

I'm facing some situation with current_timestamp, wich depending of "Windows Auto Adjust DST", is returning "wrong" time, even if I set the same timezone used by windows (in this case 'BRAZIL/EAST').

The problem is: I can tell to the users to set (or unset) Auto DST. So, is there any way to workaround this? I me开发者_运维百科an, some kind of setting on PG that will allways get the exactly same time shown on taskbar clock?

Thanks in advance.


Does it display a good time if you use the following?

select current_timestamp at time zone 'BRAZIL/EAST' as now;

Maybe your Windows clients or server have timezone set wrong or outdated timezone data. Is your server supported (at least Windows 2003 SP2) and updated with WindowsUpdate? Is your client at least Windows XP SP3 and WindowsUpdated too.

What the following query returns when connected locally from server and from remote client?

SELECT current_setting('TIMEZONE');


Christian,

i've faced the same problem.

try setting this in postgresql.conf:

timezone = 'BRAZIL/EAST'

hope that helps! ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消