I\'m trying to create the database in Rails. In Postgres I see the development and test database, however, I\'m getting a permissions error. I\'ve tried to follow this link, did
Try listing your tables to see who the owner is. In my case, I had imported data via psql < dump.sql
and all the imported tables were owned by postgres
instead of my user.
To check this, start psql
and enter the command \dt
within your database. Look for the following line:
public | schema_migrations | table | postgres
Not good! It's owned by postgres
and you'll need to fix that:
sudo -u my_user psql < dump.sql
instead of sudo -u postgres psql < dump.sql
.