3

I'm trying to create a new user in AWS Aurora Postgres DB.

Create user worked fine and I can login to the DB using that account. granting permissions to it isn't.

First:

GRANT ALL on ALL tables in schema public to username

returns:

ERROR:  permission denied for relation some_table

some_table owner is a member of the same group the the new user.

Then, trying another grant options:

ALTER DEFAULT PRIVILEGES FOR USER username IN SCHEMA public GRANT ALL ON tables TO group this_group;

returns

ERROR:  must be member of role "username"

Any idea how to solve it out?

13
  • 1
    Who are you doing this stuff as? It looks like the user doing the GRANT does not have the priv to do the GRANT. – jjanes Nov 7 '19 at 16:30
  • "some_table is a member of the same group the the new user." Table cannot be members of groups, unless that is something Aurora invented. Do you mean the table is owned by a role which the new user belongs to? If that is the case, why is a GRANT needed? – jjanes Nov 7 '19 at 16:31
  • 1. I'm using root account for that - as root as one can be. 2. Fixed the missing word - the table owner is a member of the same group as the newly created user – OLS Nov 7 '19 at 16:31
  • 2
    Have you tried logging in as the table's owner, and doing the grant from there? – jjanes Nov 7 '19 at 16:37
  • 1
    For the second statement, log in as username, then you are trivially a member of that role. – Laurenz Albe Nov 8 '19 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.