This is consistent with the behavior of other global objects such as
languages and extensions.
Omitting foreign servers also omits the respective user mappings.
if (!fdwinfo->dobj.dump || dataOnly)
return;
+ /*
+ * FDWs that belong to an extension are dumped based on their "dump" field.
+ * Otherwise omit them if we are only dumping some specific object.
+ */
+ if (!fdwinfo->dobj.ext_member)
+ if (!include_everything)
+ return;
+
q = createPQExpBuffer();
delq = createPQExpBuffer();
labelq = createPQExpBuffer();
char *fdwname;
/* Skip if not to be dumped */
- if (!srvinfo->dobj.dump || dataOnly)
+ if (!srvinfo->dobj.dump || dataOnly || !include_everything)
return;
q = createPQExpBuffer();