Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres error "invalid value for parameter "TimeZone": "UTC""

Jupitor$ bundle exec rake db:create db:migrate
APP_development already exists
rake aborted!
PG::Error: ERROR:  invalid value for parameter "TimeZone": "UTC"
: SET time zone 'UTC'

I keep getting this error when trying to migrate to my postgres database. help would be much appreciated!

like image 858
Stephen Nguyen Avatar asked Jul 10 '12 08:07

Stephen Nguyen


6 Answers

I had the same problem using the Postgres.app from Heroku. Rebooting my Mac solved it.

like image 164
MathiasJ Avatar answered Nov 09 '22 12:11

MathiasJ


Restarting postgresql works.

To restart if you've installed it using homebrew, brew info postgresql will tell you to:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
like image 81
Michiel de Mare Avatar answered Nov 09 '22 12:11

Michiel de Mare


brew services restart postgresql

like image 23
Ricardo Ruwer Avatar answered Nov 09 '22 12:11

Ricardo Ruwer


Try restarting the server. I updated Postgresql through Homebrew but forgot to restart the server and got this same problem. I believe it's due to the client and server versions not matching. psql started with:

$ psql
psql (9.1.4, server 9.1.2)
Type "help" for help.
like image 15
Turadg Avatar answered Nov 09 '22 11:11

Turadg


Based on @MathiasJ's answer, instead of rebooting my entire machine, I ran

brew services restart [email protected]

and my subsequent rake db:create worked perfectly.

like image 14
PJSCopeland Avatar answered Nov 09 '22 12:11

PJSCopeland


I don't think I deserve any points for that but rebooting my Postgres.app (which is better than rebooting the whole system) solved it for me. The app doesn't show up on the Dock, you can find it on the navbar at the top of your window. Hope it helps anyway.

like image 8
Flavio Wuensche Avatar answered Nov 09 '22 12:11

Flavio Wuensche