On 2/22/17 12:29 PM, Peter Eisentraut wrote:
On 2/22/17 10:14, Jim Nasby wrote:
CREATE MATERIALIZED VIEW tmv AS SELECT * FROM pg_subscription;
IOW, you can create matviews that depend on any other
table/view/matview, but right now if the matview includes certain items
it will mysteriously end up empty post-restore.
Yes, by that logic matview refresh should always be last.
Patches for head attached.
RLS was the first item added after DO_REFRESH_MATVIEW, which was added
in 9.5. So if we want to treat this as a bug, they'd need to be patched
as well, which is a simple matter of swapping 33 and 34.
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c
index ea643397ba..708a47f3cb 100644
@@ -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 =
- 34, /*
- 35, /* DO_POLICY */
- 36, /*
- 37, /*
- 38 /*
+ 38, /*
+ 34, /* DO_POLICY */
+ 35, /*
+ 36, /*
+ 37 /*
static DumpId preDataBoundId;
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: