avamingli commented on code in PR #1117:
URL: https://github.com/apache/cloudberry/pull/1117#discussion_r2101530553


##########
src/backend/catalog/gp_matview_aux.c:
##########
@@ -187,7 +189,12 @@ InsertMatviewAuxEntry(Oid mvoid, const Query *viewQuery, 
bool skipdata)
        values[Anum_gp_matview_aux_mvname - 1] = NameGetDatum(&mvname);
 
        values[Anum_gp_matview_aux_has_foreign - 1] = BoolGetDatum(has_foreign);
-       
+
+       matviewRel = table_open(mvoid, NoLock);
+       viewsql = nodeToString((Node *) 
copyObject(get_matview_query(matviewRel)));
+       table_close(matviewRel, NoLock);
+       values[Anum_gp_matview_aux_view_query - 1] = 
CStringGetTextDatum(viewsql);

Review Comment:
   You can't drop a column of table depended by other objects. Have a try will 
show that kind of error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org
For additional commands, e-mail: commits-h...@cloudberry.apache.org

Reply via email to