pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Create multiple users, to have all privileges on each others objects/relations
Date: Sun, 15 Nov 2020 10:16:21 -0600
Message-ID: <ff5dd1b5-03b1-8c24-7346-8c7d11248efa@gmail.com> (raw)
In-Reply-To: <CAG-jOyBFV-n+M=eS7oP4-wEizaHmVr9ZY2YfDCpU9_joQp9j6w@mail.gmail.com>
References: <CAG-jOyBFV-n+M=eS7oP4-wEizaHmVr9ZY2YfDCpU9_joQp9j6w@mail.gmail.com>

On 11/15/20 9:46 AM, otar shavadze wrote:
> 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?

Try creating a "group" role, and then "user" roles which inherit from the 
"group" role.


-- 
Angular momentum makes the world go 'round.

view thread (3+ messages)  latest in thread

Message-ID: <ff5dd1b5-03b1-8c24-7346-8c7d11248efa@gmail.com>
Permalink:  ../ff5dd1b5-03b1-8c24-7346-8c7d11248efa@gmail.com/
Also on:    postgresql.org/message-id/ff5dd1b5-03b1-8c24-7346-8c7d11248efa@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ronljohnsonjr@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Create multiple users, to have all privileges on each others objects/relations
  In-Reply-To: <ff5dd1b5-03b1-8c24-7346-8c7d11248efa@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox