Postgres error “invalid value for parameter ”TimeZone“: ”UTC“”

前端 未结 15 962
甜味超标
甜味超标 2021-02-01 00:26
Jupitor$ bundle exec rake db:create db:migrate
APP_development already exists
rake aborted!
PG::Error: ERROR:  invalid value for parameter \"TimeZone\": \"UTC\"
: SET ti         


        
15条回答
  •  無奈伤痛
    2021-02-01 00:46

    Apparently, a similar thing also happens with Java/JDBC while connecting to Postgres.

    The solution there is to tell JDBC to report the correct user timezone to Postgres while getting the connection.

    So, explicitly mention the user timezone while starting the program helps:

    java -Duser.timezone=America/Los_Angeles com.example.MyMainClass
    

    Note:

    Adding this here because this happens to be the first result on Google for this issue with connecting to Postgres!

    Source:

    This comment by Yuriy on the Jira support forum: https://community.atlassian.com/t5/Jira-questions/invalid-value-for-parameter-quot-TimeZone-quot-quot-US-Pacific/qaq-p/839426

提交回复
热议问题