User mapping: view over a foreign table

From: Vladimir Ryabtsev <greatvovan(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: User mapping: view over a foreign table
Date: 2019-07-17 21:24:04
Message-ID: CAMqTPqnFvqgOnfMwvbOW6LnyobrriUBe5yDS73f71YcSHS81AA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Supposing I have a foreign table F and a view V that selects rows from F.

The owner of F is USER1.
The owner of V is USER2.
The currently logged user is "me".

When I query the foreign table F, the DBMS engine looks for USER MAPPING
for "me", regardless of who is the owner of the table.

When I query the view V, the engine searches the USER MAPPING for USER2 who
is the owner of the view.

This looks inconsistent and misleading. I wonder, are there any reasons
behind this design decision? Is it documented somewhere (I did not find it)?

Regards,
Vlad

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vladimir Ryabtsev 2019-07-17 21:24:59 Re: User mapping: view over a foreign table
Previous Message David G. Johnston 2019-07-17 19:31:26 Re: transaction and insert