0

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?

2 Answers 2

1

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;
-1

I figured it out. First I had to login as superuser

sudo -u postgres psql

then issue

ALTER USER myuser WITH SUPERUSER;
1
  • Using a superuser for your regular work is a really bad idea. Do you also work as root all the time in Linux?
    – user1822
    Commented Mar 29, 2020 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.