Closed grimm26 closed 10 years ago
I think it just gives you a warning? Or does it actually fail?
Looks like just a warning. I first noticed when I was having other troubles, so this part is just an annoyance. If I create a rearview user and empty rearview_production db ahead of time, I get
ActiveRecord::JDBCError: org.postgresql.util.PSQLException: ERROR: permission denied to create database: CREATE DATABASE "rearview_production" ENCODING =
'utf8'
arjdbc/jdbc/RubyJdbcConnection.java:537:in `execute'
....
bin/rake:4:in `(root)'
Couldn't create database for {"adapter"=>"postgresql", "database"=>"rearview_production", "username"=>"rearview", "password"=>"rearview", "host"=>"localhost"}
But the migrate and seed works fine. It is mainly pissed off that the rearview used doesn't have permission to create a db, but one is already created for it so it does not matter.
I think its probably better to leave the warning (it comes from rails anyways), then try and spend time suppressing it. I guess I'd rather have some noise than take the chance that I accidentally swallow some warning or error messages that might be useful to others for debugging setup.
This probably isn't an issue with MySQL since you can grant all to a user for a specific database which gives a user permission to create it, but that's not how postgresql permissions work.
So... I'd like the setup to not complain when I have an empty database waiting for it so I don't have to grant CREATE permissions to the rearview postgresql user.