From: Joe Conway Date: Mon, 10 Jun 2013 00:31:51 +0000 (-0700) Subject: Fix ordering of obj id for Rules and EventTriggers in pg_dump. X-Git-Tag: REL9_1_10~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86742ac9c838cb383f951703f28938d371cb7858;p=postgresql Fix ordering of obj id for Rules and EventTriggers in pg_dump. getSchemaData() must identify extension member objects and mark them as not to be dumped. This must happen after reading all objects that can be direct members of extensions, but before we begin to process table subsidiary objects. Both rules and event triggers were wrong in this regard. Backport rules portion of patch to 9.1 -- event triggers do not exist prior to 9.3. Suggested fix by Tom Lane, initial complaint and patch by me. --- diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index 7415f0d00f..87207f7d83 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -204,10 +204,6 @@ getSchemaData(int *numTablesPtr) write_msg(NULL, "reading table inheritance information\n"); inhinfo = getInherits(&numInherits); - if (g_verbose) - write_msg(NULL, "reading rewrite rules\n"); - getRules(&numRules); - /* * Identify extension member objects and mark them as not to be dumped. * This must happen after reading all objects that can be direct members @@ -242,6 +238,10 @@ getSchemaData(int *numTablesPtr) write_msg(NULL, "reading triggers\n"); getTriggers(tblinfo, numTables); + if (g_verbose) + write_msg(NULL, "reading rewrite rules\n"); + getRules(&numRules); + *numTablesPtr = numTables; return tblinfo; }