8000 Fix ordering of obj id for Rules and EventTriggers in pg_dump. · kosalalakshitha/postgres@1723df6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1723df6

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 5cd77ba commit 1723df6

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
@@ -202,10 +202,6 @@ getSchemaData(Archive *fout, int *numTablesPtr)
202202
write_msg(NULL, "reading table inheritance information\n");
203203
inhinfo = getInherits(fout, &numInherits);
204204

205-
if (g_verbose)
206-
write_msg(NULL, "reading rewrite rules\n");
207-
getRules(fout, &numRules);
208-
209205
/*
210206
* Identify extension member objects and mark them as not to be dumped.
211207
* This must happen after reading all objects that can be direct members
@@ -240,6 +236,10 @@ getSchemaData(Archive *fout, int *numTablesPtr)
240236
write_msg(NULL, "reading triggers\n");
241237
getTriggers(fout, tblinfo, numTables);
242238

239+
if (g_verbose)
240+
write_msg(NULL, "reading rewrite rules\n");
241+
getRules(fout, &numRules);
242+
243243
*numTablesPtr = numTables;
244244
return tblinfo;
245245
}

0 commit comments

Comments
 (0)
0