I'm trying to grant all privileges on all tables of a given database to a new postgres user (not the owner). It seems that GRANT ALL PRIVILEGES ON DATABASE my_db TO new_user;
does not do that. After running said command successfully (as the postgres user), I get the following as new_user:
$ psql -d my_db
my_db => SELECT * FROM a_table_in_my_db;
ERROR: permission denied for relation a_table_in_my_db
Two questions:
1) What does the command above do, then, if not granting all permissions on all tables on my_db?
2) What's the proper way to grant all permissions on all tables to a user? (including on all tables created in the future)