From: Niels Jespersen <NJN@dst.dk>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: SV: Foreign tables, user mappings and privilege setup
Date: Tue, 22 Sep 2020 10:22:58 +0000
Message-ID: <bcbc4634847945bf9ff4378c339a60f0@dst.dk> (raw)
In-Reply-To: <1535712efb8ba93932ff5994213a7f21c0db3e56.camel@cybertec.at>
References: <d0306b1670674d70ab923c42d4340db3@dst.dk>
<1535712efb8ba93932ff5994213a7f21c0db3e56.camel@cybertec.at>
>>On Mon, 2020-09-21 at 08:21 +0000, Niels Jespersen wrote:
>> create user mapping for current_user server s... (user 'remoteuser',
>> password 'remotepassword');
>>
>> create foreign table t.... ( a int) server s... options (table_name 't_remote');
>>
>> This works fine. Except only the user who created the user mapping can
>> select from foreign table, even if other users have select privilege on the table. They will get a "user mapping not found for...".
>
>You have to create a user mapping for every user that is to access the foreign table.
>
>If several users should have the same credentials, use a group.
Thank you for replying.
I can create a user mapping for a group (role). This works, but it is not 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 table.
Is this what Oracle Corporation would call "Intended Behavior" ;=) ?
Regards Niels
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: NJN@dst.dk, laurenz.albe@cybertec.at
Subject: Re: Foreign tables, user mappings and privilege setup
In-Reply-To: <bcbc4634847945bf9ff4378c339a60f0@dst.dk>
References: <d0306b1670674d70ab923c42d4340db3@dst.dk> <1535712efb8ba93932ff5994213a7f21c0db3e56.camel@cybertec.at> <bcbc4634847945bf9ff4378c339a60f0@dst.dk>
* 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