Suppress foreign data wrappers and foreign servers in partial dumps

This is consistent with the behavior of other global objects such as
languages and extensions.

Omitting foreign servers also omits the respective user mappings.
This commit is contained in:
Peter Eisentraut 2011-05-30 23:34:34 +03:00
parent 2367da886d
commit 3001b76308
1 changed files with 9 additions and 1 deletions

View File

@ -11180,6 +11180,14 @@ dumpForeignDataWrapper(Archive *fout, FdwInfo *fdwinfo)
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();
@ -11255,7 +11263,7 @@ dumpForeignServer(Archive *fout, ForeignServerInfo *srvinfo)
char *fdwname;
/* Skip if not to be dumped */
if (!srvinfo->dobj.dump || dataOnly)
if (!srvinfo->dobj.dump || dataOnly || !include_everything)
return;
q = createPQExpBuffer();