aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-03-04 14:47:27 -0500
committerPeter Eisentraut <peter_e@gmx.net>2017-03-04 14:47:27 -0500
commitd77ff69341f20db348ba2a4b29c522a93ac8e901 (patch)
tree054087ab99af294d6ad9ea5365588e3d4fd150cc
parent272adf4f9cd67df323ae57ff3dee238b649d3b73 (diff)
downloadpostgresql-d77ff69341f20db348ba2a4b29c522a93ac8e901.tar.gz
postgresql-d77ff69341f20db348ba2a4b29c522a93ac8e901.zip
pg_dump: Fix ordering
Materialized views refresh should be last. From: Jim Nasby <Jim.Nasby@BlueTreble.com>
-rw-r--r--src/bin/pg_dump/pg_dump_sort.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index ea643397ba8..708a47f3cb7 100644
--- a/src/bin/pg_dump/pg_dump_sort.c
+++ b/src/bin/pg_dump/pg_dump_sort.c
@@ -26,6 +26,9 @@ static const char *modulename = gettext_noop("sorter");
* Sort priority for database object types.
* Objects are sorted by type, and within a type by name.
*
+ * Because materialized views can potentially reference system views,
+ * DO_REFRESH_MATVIEW should always be the last thing on the list.
+ *
* NOTE: object-type priorities must match the section assignments made in
* pg_dump.c; that is, PRE_DATA objects must sort before DO_PRE_DATA_BOUNDARY,
* POST_DATA objects must sort after DO_POST_DATA_BOUNDARY, and DATA objects
@@ -70,11 +73,11 @@ static const int dbObjectTypePriority[] =
22, /* DO_PRE_DATA_BOUNDARY */
26, /* DO_POST_DATA_BOUNDARY */
33, /* DO_EVENT_TRIGGER */
- 34, /* DO_REFRESH_MATVIEW */
- 35, /* DO_POLICY */
- 36, /* DO_PUBLICATION */
- 37, /* DO_PUBLICATION_REL */
- 38 /* DO_SUBSCRIPTION */
+ 38, /* DO_REFRESH_MATVIEW */
+ 34, /* DO_POLICY */
+ 35, /* DO_PUBLICATION */
+ 36, /* DO_PUBLICATION_REL */
+ 37 /* DO_SUBSCRIPTION */
};
static DumpId preDataBoundId;