Create multiple users, to have all privileges on each others objects/relations

From: otar shavadze <oshavadze(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Create multiple users, to have all privileges on each others objects/relations
Date: 2020-11-15 15:46:05
Message-ID: CAG-jOyBFV-n+M=eS7oP4-wEizaHmVr9ZY2YfDCpU9_joQp9j6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,
How can create multi users so, that they all have permissions on each
others DB objects ?
What I did (From "postgres" user):

CREATE ROLE postgres_subuser1 PASSWORD 'some_password';
CREATE ROLE postgres_subuser2 PASSWORD 'some_password';

ALTER DEFAULT PRIVILEGES FOR ROLE postgres_subuser1 GRANT ALL PRIVILEGES ON
TABLES TO postgres_subuser1;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres_subuser2 GRANT ALL PRIVILEGES ON
TABLES TO postgres_subuser2;

Then I logged in with "postgres_subuser1" and created table "table1".
Then I logged in with "postgres_subuser2" and tried: "SELECT COUNT(*) FROM
table1". This gives error: "permission denied for table table1"

Tell please, What is my mistake?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2020-11-15 16:16:21 Re: Create multiple users, to have all privileges on each others objects/relations
Previous Message MichaelDBA 2020-11-12 23:33:18 Re: Pgpool for Pooling and Load Balancing