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 1kKj5M-00036R-9I for pgsql-general@arkaria.postgresql.org; Tue, 22 Sep 2020 14:16:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kKj5L-0007Ef-2K for pgsql-general@arkaria.postgresql.org; Tue, 22 Sep 2020 14:15:59 +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 1kKj5K-0007EY-RJ for pgsql-general@lists.postgresql.org; Tue, 22 Sep 2020 14:15:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKj5I-00025f-Og for pgsql-general@lists.postgresql.org; Tue, 22 Sep 2020 14:15:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08MEFo1E1177002; Tue, 22 Sep 2020 10:15:50 -0400 From: Tom Lane To: Niels Jespersen cc: Laurenz Albe , "pgsql-general@lists.postgresql.org" Subject: Re: SV: Foreign tables, user mappings and privilege setup In-reply-to: References: <1535712efb8ba93932ff5994213a7f21c0db3e56.camel@cybertec.at> Comments: In-reply-to Niels Jespersen message dated "Tue, 22 Sep 2020 10:22:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1177000.1600784150.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 22 Sep 2020 10:15:50 -0400 Message-ID: <1177001.1600784150@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Niels Jespersen writes: > I can create a user mapping for a group (role). This works, but it is no= t enough to grant the role to the end user (that has inherit defined). The= end user must explicitly use "set role" before accessing the foreign tabl= e. Seems right to me. If the user is a member of two groups, each of which has a mapping for that server, how could the server choose one? regards, tom lane