Postres’ command line interface can be used with
$ psql -U <user> <db>
http://www.postgresql.org/docs/current/static/backup-dump.html
http://www.postgresql.org/docs/current/static/migration.html
To grant a user some (or all) permissions on all tables in a database:
SELECT 'grant all on '||tablename||' to <user>;' FROM pg_tables WHERE tablename LIKE '<tname>';
It prints a list of commands to execute.