Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jvLU6-0003WF-JL for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2020 14:00:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jvLU5-0006Rm-JH for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2020 14:00:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jvLSw-0002VH-8u for pgsql-general@lists.postgresql.org; Tue, 14 Jul 2020 13:59:26 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jvLSu-0007OT-7g for pgsql-general@lists.postgresql.org; Tue, 14 Jul 2020 13:59:25 +0000 Received: by mail-lj1-x22b.google.com with SMTP id r19so22794243ljn.12 for ; Tue, 14 Jul 2020 06:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=ed9TOrlyLCxE9ukQ004lbNXIRNBYbkIEKZ4CHcad/W8=; b=ElQ3SMKxX/GH8pN7zAT0AOYrmrBCEzvjfHPdkrB3bZmucqZxfVlow3oZVduvx9saXn bSYy2FZs5UkI4/9gpptgITnEs29mRasn2mwF7HMCtezz21ntDiw9iCY1/XavJc8yQ11O 4OhaOljaBgUPbllZszaDls6wGdvbB2qMCYisHzeSZkttrvlAnKnzl1wXFi+/BP2jNEg9 qcKn5Cu7MlcTmbW6qLGGzWTMEwXo/aebWdHPk3WZmWxUGgpk0c11JWxYC9TT+0PaFYxb GzZXeLJh7p7xg6nnt3h//1qCr69H4DgytRifkpGj7dWN895/14mb1H2QfUgzW+7YV522 DoKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=ed9TOrlyLCxE9ukQ004lbNXIRNBYbkIEKZ4CHcad/W8=; b=Yne30LIHTECRasPN5XKvdEUJW+6s4qgOwXyeNCYcFUH6B0EmKsKz12dgI+zdQZbd1c SKZSr+qMeMjY26zHZZHF2NKSGLBuUko55/f9OicseyHmobutBHhx2vYnnKBQnix6UbG+ J3mx15/Y8qvJhEyJXU5brF/jT1Q5jA3UzFAhoWPXv3wXxEO/9hIctc0jDI5RMLxXlgBP b95CzPGYjcpvMXgZhIdUTTdOWuHWc3YJ5QBqYK7GaYsUPHBCkodqcJFkvxDNJ3qRKzFc NBKeBDR4KYUnMEOmzQ7t6MWgvb6qGXMqIQL6PYgwEdXO6PjN30CufPVudbWgMvpKHPnS R4Gg== X-Gm-Message-State: AOAM531/6MJjcMT2/fOwo5P6s1kN9DqPI0gbebJKQ6xwF0UEZOCo/4AZ Xb/bE6t2BCOgHyp5HdU3bTA= X-Google-Smtp-Source: ABdhPJxvkxb4Ev5NmUdwN7J50yZc2M38PsKxqkYFK2DXCUwE/J7MQoH/MLQqh4TYL1TlxGRERmsdxg== X-Received: by 2002:a2e:7203:: with SMTP id n3mr2323728ljc.174.1594735162402; Tue, 14 Jul 2020 06:59:22 -0700 (PDT) Received: from [192.168.10.108] (133-225-29-85.dyn.estpak.ee. [85.29.225.133]) by smtp.gmail.com with ESMTPSA id j26sm5295818lfm.11.2020.07.14.06.59.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jul 2020 06:59:21 -0700 (PDT) From: Toomas Kristin Message-Id: <84AD5C5D-0DBF-429B-BEAC-D8DC01F33395@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_F833A804-8AFA-4D7B-81B8-2659025233C5" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Both side privileges Date: Tue, 14 Jul 2020 16:59:20 +0300 In-Reply-To: Cc: "David G. Johnston" , "pgsql-general@lists.postgresql.org" To: Jean-Philippe Chenel References: X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_F833A804-8AFA-4D7B-81B8-2659025233C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 And please be sure that default permissions are defined properly. = Otherwise it may happen that userA creates a new table but userB has = access for that. Alternative option is that user has to grant proper = access for the role group after every time when a new db object is = created. Toomas > On 14. Jul 2020, at 16:36, Jean-Philippe Chenel = wrote: >=20 > Thank for your answer David. > This is what I'll do. > De : David G. Johnston > > Envoy=C3=A9 : 13 juillet 2020 19:46 > =C3=80 : Jean-Philippe Chenel > > Cc : pgsql-general@lists.postgresql.org = = > > Objet : Re: Both side privileges > =20 > On Mon, Jul 13, 2020 at 4:42 PM Jean-Philippe Chenel = > wrote: > Hi, >=20 > I try to give userA privileges on userB objects and same thing to the = userB, giving privileges on userA objects.=20 >=20 > Grant userB to userA; =E2=80=94ok > Grant userA to userB; =E2=80=94error: role userB is already member of = role userA >=20 > Create a "group role" that retains ownership and then add both users = to that group. >=20 > David J. --Apple-Mail=_F833A804-8AFA-4D7B-81B8-2659025233C5 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

And please be sure that default = permissions are defined properly. Otherwise it may happen that userA = creates a new table but userB has access for that. Alternative option is = that user has to grant proper access for the role group after every time = when a new db object is created.

Toomas

On 14. Jul 2020, at 16:36, = Jean-Philippe Chenel <jp.chenel@live.ca> wrote:

Thank for your answer David.
This is what I'll do.

De : David G. Johnston <david.g.johnston@gmail.com>
Envoy=C3=A9 : 13 juillet 2020 19:46
=C3=80 : Jean-Philippe Chenel <jp.chenel@live.ca>
Cc : pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Objet : Re: Both side = privileges
 
On Mon, Jul 13, 2020 at 4:42 PM Jean-Philippe Chenel <jp.chenel@live.ca> = wrote:
Hi,

I try to give userA = privileges on userB objects and same thing to the userB, giving = privileges on userA objects. 

Grant userB to userA; = =E2=80=94ok
Grant userA to userB; =E2=80=94error: role userB is already = member of role userA

Create a "group role" that retains = ownership and then add both users to that group.

David = J.

= --Apple-Mail=_F833A804-8AFA-4D7B-81B8-2659025233C5--