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 1jYsdk-000662-VT for pgsql-general@arkaria.postgresql.org; Wed, 13 May 2020 14:45:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYsdj-000545-SL for pgsql-general@arkaria.postgresql.org; Wed, 13 May 2020 14:45:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYsdj-00053x-KG for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 14:45:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYsdg-0007Cg-BC for pgsql-general@lists.postgresql.org; Wed, 13 May 2020 14:45:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04DEjZOd000506; Wed, 13 May 2020 10:45:35 -0400 From: Tom Lane To: Gerard Weatherby cc: pgsql-general@lists.postgresql.org Subject: Re: Create user mapping for role In-reply-to: References: Comments: In-reply-to Gerard Weatherby message dated "Wed, 13 May 2020 09:44:50 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <504.1589381135.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 13 May 2020 10:45:35 -0400 Message-ID: <505.1589381135@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Gerard Weatherby writes: > Can a foreign data wrapper user mapping by created for multiple users vi= a a role? i.e. if bob, sally, and john belong to role foreigusers, is it p= ossible to do something like > Create user mapping for foreignusers server =E2=80=A6 You can certainly create a user mapping for a role. But I think you'll find that sally et al have to do "SET ROLE foreignusers" to use it. It's difficult to see a way to avoid that --- after all, if sally is also a member of foreignuserstoo that also has a mapping, which one should the system use? regards, tom lane