]> granicus.if.org Git - postgresql/commitdiff
Fix ordering of obj id for Rules and EventTriggers in pg_dump.
authorJoe Conway <mail@joeconway.com>
Mon, 10 Jun 2013 00:31:26 +0000 (17:31 -0700)
committerJoe Conway <mail@joeconway.com>
Mon, 10 Jun 2013 00:31:26 +0000 (17:31 -0700)
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.

src/bin/pg_dump/common.c

index b02217e81d5bebdf6e8258c1a223d1d3944b047a..1fcc39fcb87c2c80d04bb6b9d01f48665205c74c 100644 (file)
@@ -202,10 +202,6 @@ getSchemaData(Archive *fout, int *numTablesPtr)
                write_msg(NULL, "reading table inheritance information\n");
        inhinfo = getInherits(fout, &numInherits);
 
-       if (g_verbose)
-               write_msg(NULL, "reading rewrite rules\n");
-       getRules(fout, &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
@@ -240,6 +236,10 @@ getSchemaData(Archive *fout, int *numTablesPtr)
                write_msg(NULL, "reading triggers\n");
        getTriggers(fout, tblinfo, numTables);
 
+       if (g_verbose)
+               write_msg(NULL, "reading rewrite rules\n");
+       getRules(fout, &numRules);
+
        *numTablesPtr = numTables;
        return tblinfo;
 }