can't grant user privileges to postgresql database (for a rails app)

have you tried:

--Change the database ownership
alter database lateraldev owner to pavan;

--and do the same for all tables
psql -tc "select 'alter table ' || tablename || ' owner to pavan;' from pg_tables where schemaname not in ('pg_catalog', 'information_schema');" lateraldev | psql -a lateraldev

so after some digging around. Found this on the postgres website. Essentially anything other than a table name needs the type to be explicitly called when granting the permission.

GRANT ALL PRIVILEGES ON DATABASE my_newly_created_db_name TO my_user_name;

http://www.postgresql.org/message-id/[email protected]


Try making the user with CREATEDB permission, and then you can create the database with that user. The user will have permission on that database from then on.

CREATE USER myuser CREATEDB;

I know this isn't a perfect solution, but I hope this works out for you

-Brian