2016-09-21 53 views
0

當我通過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

回答

2

看看

postgres default timezone

看到數據庫的理解是什麼時區名稱:

SELECT * FROM pg_timezone_names; 
+0

幫我去釘住它 - 在我的Postgres安裝中,它理解「GMT」和「UCT」,但不是「UTC」 –

相關問題