Re: Foreign tables, user mappings and privilege setup

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Niels Jespersen <NJN(at)dst(dot)dk>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Foreign tables, user mappings and privilege setup
Date: 2020-09-21 14:10:06
Message-ID: 1535712efb8ba93932ff5994213a7f21c0db3e56.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Drake 2020-09-21 17:53:08 Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?
Previous Message Niels Jespersen 2020-09-21 08:21:12 Foreign tables, user mappings and privilege setup