Re: no mention of GRANT USAGE in postgres_fdw docs

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: joe(at)nahmias(dot)net, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: no mention of GRANT USAGE in postgres_fdw docs
Date: 2019-11-15 19:42:16
Message-ID: CAKFQuwbLyaAv8i9q_82kD+UNCet4emWgOy2PiQ8LT6Ld7r+KWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Fri, Nov 15, 2019 at 12:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> > The documentation page for postgres_fdw
> > <https://www.postgresql.org/docs/current/postgres-fdw.html> gives a nice
> > step by step on what's needed to configure a FOREIGN SERVER. However,
> one
> > crucial step is missed, and that is that you need to issue GRANT USAGE ON
> > FOREIGN SERVER before you can successfully run step 4, IMPORT FOREIGN
> > SCHEMA.
>
> That paragraph links to the IMPORT FOREIGN SCHEMA reference page,
> which says
>
> To use IMPORT FOREIGN SCHEMA, the user must have USAGE privilege on
> the foreign server, as well as CREATE privilege on the target schema.
>
> I'm not clear why we should duplicate that information here, especially
> when we're not duplicating any of the other essential information about
> how to use IMPORT FOREIGN SCHEMA. Nor does this summary mention the
> privilege requirements for any of the other commands it suggests using.
>

The overview page says: "Create a user mapping, using CREATE USER MAPPING,
for each database user you want to allow to access each foreign server."
It seems reasonable to add that you need to grant those same users the
USAGE privilege on each foreign server as well. The bullet list does seem
like it is inclusive of all the major SQL Commands that are needed to make
this work and since it doesn't just speak of setting up the owner's
permissions mentioning GRANT, while slightly redundant, seems in scope.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2019-11-15 19:50:41 Re: no mention of GRANT USAGE in postgres_fdw docs
Previous Message Jeff Janes 2019-11-15 19:09:59 Add <caution> for ALTER TEXT SEARCH CONFIGURATION