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.
This commit is contained in:
Joe Conway 2013-06-09 17:31:51 -07:00
parent a2c2336f96
commit 86742ac9c8

View file

@ -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;
}