Hello, I have an issue when trying to connect to a recent (v18) postgresql database using next-jdbc. Whenever I try to execute a query I get the following error:
FATAL: invalid value for parameter "TimeZone": "America/Buenos_Aires"
This is my sample code:
(ns app.core
(:require [next.jdbc :as jdbc]))
(def db
{:dbtype "postgresql"
:dbname "app"
:host "localhost"
:port 5432
:user "app"
:password "app"})
(def ds (jdbc/get-datasource db))
(defn -main []
(println "My TZ:")
(println (java.time.ZoneId/systemDefault))
(println "Query:")
(println (jdbc/execute! ds ["select current_timestamp"])))
It prints the following text:
My TZ:
#object[java.time.ZoneRegion 0x5a917723 America/Buenos_Aires]
Execution error (PSQLException) at org.postgresql.core.v3.QueryExecutorImpl/receiveErrorResponse (QueryExecutorImpl.java:2993).
FATAL: invalid value for parameter "TimeZone": "America/Buenos_Aires"
Debian 13, which is the OS the postgres docker image is based on, has "deprecated" some timezones and moved them to legacy package. And it no longer accepts the default Windows timezone (unless the package is installed by modifying the docker image).
I know I can set the JVM timezone when running the program:
clj -J"-Duser.timezone=America/Argentina/Buenos_Aires" -M -m app.core
My TZ:
#object[java.time.ZoneRegion 0x7e4579c7 America/Argentina/Buenos_Aires]
Query:
[{:current_timestamp #inst "2026-10-29T13:12:23.223933000-00:00"}]
which works but it's cumbersome.
Is there a file I can use to set default JVM options? like jvm.option? I also tried with :jvm-opts inside deps.edn but I don't really understand how aliases work.
Thanks!