當我通過timedatectl set-timezone UTC
將我的服務器上的時區設置爲UTC並重新啓動Postgres服務器時,我可以通過psql連接並驗證select now()
返回正確的值。Clojure:在將操作系統時區更改爲UTC後,java.jdbc無法連接到Postgres
當我嘗試啓動我的Clojure的應用程序,並運行一個查詢,我得到以下錯誤:
Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: org.postgresql.util.PSQLException: FATAL: invalid value for parameter "TimeZone": "UTC"
我用我的應用程序下面的數據庫庫:
[org.postgresql/postgresql "9.4.1208"]
[clojure.jdbc/clojure.jdbc-c3p0 "0.3.2"]
[org.clojure/java.jdbc "0.6.1"]
錯誤看起來像來自Postgres,但只有在通過Clojure應用連接時纔會發生。
一切正常,如果我將OS時區到America/New_York
幫我去釘住它 - 在我的Postgres安裝中,它理解「GMT」和「UCT」,但不是「UTC」 –