@@ -26,6 +26,9 @@ static const char *modulename = gettext_noop("sorter");
2626 * Sort priority for database object types.
2727 * Objects are sorted by type, and within a type by name.
2828 *
29+ * Because materialized views can potentially reference system views,
30+ * DO_REFRESH_MATVIEW should always be the last thing on the list.
31+ *
2932 * NOTE: object-type priorities must match the section assignments made in
3033 * pg_dump.c; that is, PRE_DATA objects must sort before DO_PRE_DATA_BOUNDARY,
3134 * POST_DATA objects must sort after DO_POST_DATA_BOUNDARY, and DATA objects
@@ -70,11 +73,11 @@ static const int dbObjectTypePriority[] =
7073 22 , /* DO_PRE_DATA_BOUNDARY */
7174 26 , /* DO_POST_DATA_BOUNDARY */
7275 33 , /* DO_EVENT_TRIGGER */
73- 34 , /* DO_REFRESH_MATVIEW */
74- 35 , /* DO_POLICY */
75- 36 , /* DO_PUBLICATION */
76- 37 , /* DO_PUBLICATION_REL */
77- 38 /* DO_SUBSCRIPTION */
76+ 38 , /* DO_REFRESH_MATVIEW */
77+ 34 , /* DO_POLICY */
78+ 35 , /* DO_PUBLICATION */
79+ 36 , /* DO_PUBLICATION_REL */
80+ 37 /* DO_SUBSCRIPTION */
7881};
7982
8083static DumpId preDataBoundId ;
0 commit comments