You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AQUMV] Fix materialized view rename to also update gp_matview_aux
Fix#1116
This addresses issue where renaming a materialized view wasn't
properly updating the corresponding entry in gp_matview_aux system
table.
The fix maintains data integrity between materialized views and their
auxiliary metadata by ensuring both are renamed atomically during
ALTER MATERIALIZED VIEW RENAME operations.
Authored-by: Zhang Mingli avamingli@gmail.com
Copy file name to clipboardExpand all lines: src/test/regress/expected/matview_data.out
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -867,6 +867,32 @@ from gp_segment_configuration where role = 'p' and content = -1;
867
867
--
868
868
-- End of Maintain materialized views on partitioned tables from bottom to up.
869
869
--
870
+
-- Test Rename matview.
871
+
begin;
872
+
create materialized view mv_name1 as
873
+
select * from par with no data;
874
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' as the Apache Cloudberry data distribution key for this table.
875
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
876
+
select count(*) from gp_matview_aux where mvname = 'mv_name1';
877
+
count
878
+
-------
879
+
1
880
+
(1 row)
881
+
882
+
alter materialized view mv_name1 rename to mv_name2;
883
+
select count(*) from gp_matview_aux where mvname = 'mv_name1';
884
+
count
885
+
-------
886
+
0
887
+
(1 row)
888
+
889
+
select count(*) from gp_matview_aux where mvname = 'mv_name2';
0 commit comments