a-chernykh / railsbox

Fast and easy Ruby on Rails virtual machines
https://railsbox.io
MIT License
320 stars 52 forks source link

Grant additional permissions to the postgres user #8

Closed EdgarOrtegaRamirez closed 9 years ago

EdgarOrtegaRamirez commented 9 years ago

Before

vagrant=# select * from pg_user;
 usename  | usesysid | usecreatedb | usesuper | usecatupd | userepl |  passwd  |
----------+----------+-------------+----------+-----------+---------+----------+
 postgres |       10 | t           | t        | t         | t       | ******** |
 vagrant  |    16384 | t           | f        | f         | f       | ******** |
(2 rows)

After

vagrant=# select * from pg_user;
 usename  | usesysid | usecreatedb | usesuper | usecatupd | userepl |  passwd  |
----------+----------+-------------+----------+-----------+---------+----------+
 postgres |       10 | t           | t        | t         | t       | ******** |
 vagrant  |    16384 | t           | t        | t         | f       | ******** |
(2 rows)

Why?

I'm working on a Rails 3.x.x project which uses the hstore extension. The extension installs correctly on the development database, but when I try to run rake db:test:prepare the hstore extension can't be installed on the test database due to lack of permissions for the Vagrant Postgres user.

a-chernykh commented 9 years ago

Looks good, thanks!