Subject: document effect of USAGE on foreign server to dblink

From: Jeff Janes <[email-masked]>
Date: Wed, 27 Nov 2019 11:33:03 -0500

I think that the permissions around the usage of foreign server names as
connection names in dblink should be documented, as in the attached.

Also, for dblink itself it says "It is recommended to use the foreign-data
wrapper dblink_fdw when defining the foreign server".  Is there a reason
for this recommendation?  postgres_fdw seems to work fine on the surface,
is there some hidden trap in using it?

Cheers,

Jeff

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 19 Dec 2019 11:43:14 -0500

> connection names in dblink should be documented, as in the attached.

Uh, this looks like an odd place to document it, since this part is
talking about permissions.

> wrapper dblink_fdw when defining the foreign server".  Is there a reason for
> this recommendation?  postgres_fdw seems to work fine on the surface, is there
> some hidden trap in using it?

I have no idea.

---------------------------------------------------------------------------

> diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
> index 0be0774..a171a00 100644
> --- a/doc/src/sgml/ddl.sgml
> +++ b/doc/src/sgml/ddl.sgml
> @@ -1829,7 +1829,8 @@ REVOKE ALL ON accounts FROM PUBLIC;
>        <para>
>         For foreign servers, allows creation of foreign tables using the
>         server.  Grantees may also create, alter, or drop their own user
> -       mappings associated with that server.
> +       mappings associated with that server. Grantees may also use the foreign
> +       server as a connection name in <xref linkend="dblink"/>.
>        </para>
>       </listitem>
>      </varlistentry>

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +

---

From: Jeff Janes <[email-masked]>
Date: Thu, 19 Dec 2019 15:54:44 -0500

> talking about permissions.

Yes, giving this permission gives you usage of it in a place that is
non-obvious, and that the doc  doesn't mention.  Isn't the place about
permission the correct place to document these non-obvious permissions?

Cheers,

Jeff

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 23 Dec 2019 17:48:37 -0500

> permission the correct place to document these non-obvious permissions?

How is using a foreign server name in dblink a permission?