From: Shigeru Hanada Date: Thu, 25 Nov 2010 06:35:23 +0000 (+0900) Subject: Fix pg_dump to omit whole of OPTIONS clause when the foreign table X-Git-Url: http://git.postgresql.org/gitweb/stat%3Cscript%20data-cfasync=?a=commitdiff_plain;h=eb55cb2ad5b23d2d8772727ef51176a35abba76c;p=users%2Fhanada%2Fpostgres.git Fix pg_dump to omit whole of OPTIONS clause when the foreign table has no generic option. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index e9872b8996..8f7ece479b 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -11012,7 +11012,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) k; bool toast_set = false; char *srvname; - char *ftoptions; + char *ftoptions = NULL; /* Make sure we are in proper schema */ selectSourceSchema(tbinfo->dobj.namespace->dobj.name); @@ -11287,7 +11287,8 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) appendPQExpBuffer(q, ")"); } - if (tbinfo->relkind == RELKIND_FOREIGN_TABLE) + /* Dump generic options if any */ + if (ftoptions && ftoptions[0]) appendPQExpBuffer(q, "\nOPTIONS (%s)", ftoptions); appendPQExpBuffer(q, ";\n");