Skip to content

Commit 86742ac

Browse files
committed
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.
1 parent a2c2336 commit 86742ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/pg_dump/common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,6 @@ getSchemaData(int *numTablesPtr)
204204
write_msg(NULL, "reading table inheritance information\n");
205205
inhinfo = getInherits(&numInherits);
206206

207-
if (g_verbose)
208-
write_msg(NULL, "reading rewrite rules\n");
209-
getRules(&numRules);
210-
211207
/*
212208
* Identify extension member objects and mark them as not to be dumped.
213209
* This must happen after reading all objects that can be direct members
@@ -242,6 +238,10 @@ getSchemaData(int *numTablesPtr)
242238
write_msg(NULL, "reading triggers\n");
243239
getTriggers(tblinfo, numTables);
244240

241+
if (g_verbose)
242+
write_msg(NULL, "reading rewrite rules\n");
243+
getRules(&numRules);
244+
245245
*numTablesPtr = numTables;
246246
return tblinfo;
247247
}

0 commit comments

Comments
 (0)