Postgresql – Postgres DB user permission

postgresql

I'm logged in as a user in postgres with PgAdmin tool in Linux connecting remotely but I don't think the user has enough rights. I'm a MySQL experienced user but not so much in Postgres. When I select a table when logged in as the user I get

An error has occurred:

ERROR: permission denied for relation acs_activities

how do I add my user "gainpm" to have access to all tables in "projop" database?

Best Answer

You should log in as the table owner (the user you used to create the tables) and then grant the necessary privileges to your user:

grant select on acs_activities to your_user;

If you want to do that for all tables, you can use:

grant select on all tables in schema public to you_user;

Or maybe you created them as the superuser, but your regular user should be the real owner, then you should do:

alter table acs_activities owner to your_user;