diff options
Diffstat (limited to 'src/backend/commands/cluster.c')
-rw-r--r-- | src/backend/commands/cluster.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ef9c5f1adc7..ed62246cc52 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -381,13 +381,14 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose, check_index_is_clusterable(OldHeap, indexOid, recheck, AccessExclusiveLock); /* - * Quietly ignore the request if the a materialized view is not scannable. - * No harm is done because there is nothing no data to deal with, and we - * don't want to throw an error if this is part of a multi-relation - * request -- for example, CLUSTER was run on the entire database. + * Quietly ignore the request if this is a materialized view which has not + * been populated from its query. No harm is done because there is no data + * to deal with, and we don't want to throw an error if this is part of a + * multi-relation request -- for example, CLUSTER was run on the entire + * database. */ if (OldHeap->rd_rel->relkind == RELKIND_MATVIEW && - !OldHeap->rd_isscannable) + !OldHeap->rd_ispopulated) { relation_close(OldHeap, AccessExclusiveLock); return; @@ -923,7 +924,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, if (OldHeap->rd_rel->relkind == RELKIND_MATVIEW) /* Make sure the heap looks good even if no rows are written. */ - SetRelationIsScannable(NewHeap); + SetMatViewToPopulated(NewHeap); /* * Scan through the OldHeap, either in OldIndex order or sequentially; |