Re: User mapping: view over a foreign table - Mailing list pgsql-bugs

From Vladimir Ryabtsev
Subject Re: User mapping: view over a foreign table
Date
Msg-id CAMqTPqmzFQadU3YDU24jss+TmKmrkDjLHyWA1ZkF_yDjdZMzpQ@mail.gmail.com
Whole thread Raw
In response to User mapping: view over a foreign table  (Vladimir Ryabtsev <greatvovan@gmail.com>)
List pgsql-bugs
My DB version(): PostgreSQL 10.3 (Ubuntu 10.3-1.pgdg14.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4, 64-bit

ср, 17 июл. 2019 г. в 14:24, Vladimir Ryabtsev <greatvovan@gmail.com>:
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

pgsql-bugs by date:

Previous
From: Vladimir Ryabtsev
Date:
Subject: User mapping: view over a foreign table
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #15896: pg_upgrade from 10-or-earlier: TRAP: FailedAssertion(»!(metad->btm_version >= 3)«