Re: postgres_fdw user mapping and role inheritance

From: Natalie Wenz <nataliewenz(at)ebureau(dot)com>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: postgres_fdw user mapping and role inheritance
Date: 2015-07-17 17:51:37
Message-ID: 457CD1FA-008B-4E6D-8E80-FB7DBB35E215@ebureau.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Oh! Of course! The local database doesn't know anything about the role privileges on the remote database, so the information isn't even available on the local database to somehow take the union of all the privileges of foo and bar because they are defined on the remote database. Thanks for responding. I got so wrapped up in our simple use case (where any individual_user in the local_group would connect to foreign_server as the same foreign_user) and couldn't come up with a counter example.

For our use case, can you think of any other way to do it besides creating a user mapping for every member of local_group? Gilberto's suggestion of setting the session authorization (I think?) won't work because the individual_users don't have privileges to set that. ("ERROR: permission denied to set session authorization")

Thanks again for your responses; I appreciate the help!

Natalie

> On Jul 16, 2015, at 3:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Natalie Wenz <nataliewenz(at)ebureau(dot)com> writes:
>> Would it be necessary to disambiguate?
>
> Of course. If the mapping for group_x says to connect to the remote
> server as user foo, while the mapping for group_y says to connect
> as user bar, then it matters which one we use. But there would be no
> principled way to choose, if the current userid is a member of both
> group_x and group_y.
>
> regards, tom lane
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2015-07-17 17:59:05 Re: postgres_fdw user mapping and role inheritance
Previous Message Masaru Sugawara 2015-07-17 12:06:44 Re: リネージュIIオープンベータ登録完了のお知らせ