From 4b63d9f61c4f8e1ab3a9a09d4679acf02ec60eff Mon Sep 17 00:00:00 2001 From: Kexiang Wang Date: Tue, 13 Aug 2024 21:38:04 -0400 Subject: [PATCH] fix(catalog): add mv indexes to pg_indexes (#17981) --- .../src/catalog/system_catalog/pg_catalog/pg_indexes.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontend/src/catalog/system_catalog/pg_catalog/pg_indexes.rs b/src/frontend/src/catalog/system_catalog/pg_catalog/pg_indexes.rs index a602e71804777..05741c7b89ef6 100644 --- a/src/frontend/src/catalog/system_catalog/pg_catalog/pg_indexes.rs +++ b/src/frontend/src/catalog/system_catalog/pg_catalog/pg_indexes.rs @@ -29,6 +29,15 @@ use risingwave_frontend_macro::system_catalog; JOIN rw_catalog.rw_tables t ON i.primary_table_id = t.id JOIN rw_catalog.rw_schemas s ON i.schema_id = s.id UNION ALL + SELECT s.name AS schemaname, + t.name AS tablename, + i.name AS indexname, + NULL AS tablespace, + i.definition AS indexdef + FROM rw_catalog.rw_indexes i + JOIN rw_catalog.rw_materialized_views t ON i.primary_table_id = t.id + JOIN rw_catalog.rw_schemas s ON i.schema_id = s.id + UNION ALL SELECT s.name AS schemaname, t.name AS tablename, concat(t.name, '_pkey') AS indexname,