pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: zluther89@gmail.com
Subject: dblink_connect grant privelages on foreign db table
Date: Thu, 10 Sep 2020 15:27:03 +0000
Message-ID: <159975162317.19777.1869528586555716998@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/contrib-dblink-connect.html
Description:

In this section of dblink_connect
```
CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw OPTIONS (hostaddr
'127.0.0.1', dbname 'contrib_regression');

CREATE USER regress_dblink_user WITH PASSWORD 'secret';
CREATE USER MAPPING FOR regress_dblink_user SERVER fdtest OPTIONS (user
'regress_dblink_user', password 'secret');
GRANT USAGE ON FOREIGN SERVER fdtest TO regress_dblink_user;
GRANT SELECT ON TABLE foo TO regress_dblink_user;

\set ORIGINAL_USER :USER
\c - regress_dblink_user
SELECT dblink_connect('myconn', 'fdtest');
 dblink_connect 
----------------
 OK
(1 row)

SELECT * FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c
text[]); ```

The GRANT SELECT seemingly attempts to give a local user permissions on a
table in a foreign db. This results in an error:
 ``` relation 'foo' does not exist ```

I would like to be able to local permissions on a user's ability to access
foreign tables, but this does not seem correct.


Message-ID: <159975162317.19777.1869528586555716998@wrigleys.postgresql.org>
Permalink:  ../159975162317.19777.1869528586555716998@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/159975162317.19777.1869528586555716998@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, zluther89@gmail.com
  Subject: Re: dblink_connect grant privelages on foreign db table
  In-Reply-To: <159975162317.19777.1869528586555716998@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox