Re: SV: Foreign tables, user mappings and privilege setup

2020-09-22 Thread Tom Lane
Niels Jespersen writes: > 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. Seems right to me. If the user is a membe

SV: Foreign tables, user mappings and privilege setup

2020-09-22 Thread Niels Jespersen
>>On Mon, 2020-09-21 at 08:21 +, 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 u

Re: Foreign tables, user mappings and privilege setup

2020-09-21 Thread Laurenz Albe
On Mon, 2020-09-21 at 08:21 +, 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 c

Foreign tables, user mappings and privilege setup

2020-09-21 Thread Niels Jespersen
Hello all I am a bit confused about how to design privileges properly around foreign tables. Here's the setup. -- As superuser create server s foreign data wrapper postgres_fdw options (host 'hhh.d', dbname 'db1', port '5432'); grant usage on foreign server s... to public; -- This does not