From: Joe Conway Date: Mon, 10 Jun 2013 00:30:39 +0000 (-0700) Subject: Fix ordering of obj id for Rules and EventTriggers in pg_dump. X-Git-Tag: REL9_3_BETA2~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33a4466f767be8b153ef1ef78433ad9b1867dab8;p=thirdparty%2Fpostgresql.git 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 ae52ac11ede..58322dc59a6 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -203,8 +203,8 @@ getSchemaData(Archive *fout, int *numTablesPtr) inhinfo = getInherits(fout, &numInherits); if (g_verbose) - write_msg(NULL, "reading rewrite rules\n"); - getRules(fout, &numRules); + write_msg(NULL, "reading event triggers\n"); + getEventTriggers(fout, &numEventTriggers); /* * Identify extension member objects and mark them as not to be dumped. @@ -241,8 +241,8 @@ getSchemaData(Archive *fout, int *numTablesPtr) getTriggers(fout, tblinfo, numTables); if (g_verbose) - write_msg(NULL, "reading event triggers\n"); - getEventTriggers(fout, &numEventTriggers); + write_msg(NULL, "reading rewrite rules\n"); + getRules(fout, &numRules); *numTablesPtr = numTables; return tblinfo;