Redshift Observatory

System Table Tracker

System view pg_catalog.svl_mv_refresh_status version 1.0.116263 / 2025-06-28

schema name column data type
pg_catalog svl_mv_refresh_status db_name name
pg_catalog svl_mv_refresh_status endtime timestamp
pg_catalog svl_mv_refresh_status mv_name name
pg_catalog svl_mv_refresh_status refresh_type char(32)
pg_catalog svl_mv_refresh_status schema_name name
pg_catalog svl_mv_refresh_status starttime timestamp
pg_catalog svl_mv_refresh_status status text
pg_catalog svl_mv_refresh_status userid int8
pg_catalog svl_mv_refresh_status xid int8

View Text

SELECT e.datname AS db_name,
       a.userid,
       b.nspname AS schema_name,
       d.relname AS mv_name,
       a.xid,
       a.starttime,
       a.endtime,
       CASE
         WHEN a.status = -19
           THEN CAST('Refresh failed. Zero-ETL history mode tables support for materialized views is currently turned off.' AS text)
         WHEN a.status = -18
           THEN CAST('Refresh failed. Related Zero-ETL table has changed to History mode. Please recreate the materialized view.' AS text)
         WHEN a.status = -17
           THEN CAST('Refresh failed. Related Zero-ETL table it not in accessible.' AS text)
         WHEN a.status = -16
           THEN CAST('Refresh failed. A base table is is protected by dynamic data masking.' AS text)
         WHEN a.status = -15
           THEN CAST('Refresh failed. An external base table was not found' AS text)
         WHEN a.status = -14
           THEN CAST('Refresh failed. An external database was not found' AS text)
         WHEN a.status = -13
           THEN CAST('Refresh failed. An external base table schema was not found' AS text)
         WHEN a.status = -12
           THEN CAST('Refresh failed. A base table has been RLS-protected' AS text)
         WHEN a.status = -11
           THEN CAST('Refresh failed. A base table schema was renamed' AS text)
         WHEN a.status = -10
           THEN CAST('Refresh failed. Table changed by vacuum/truncate concurrently' AS text)
         WHEN a.status = -9
           THEN CAST('Refresh failed. Serializable isolation violation.' AS text)
         WHEN a.status = -8
           THEN CAST('Refresh failed due to an internal error' AS text)
         WHEN a.status = -7
           THEN CAST('Refresh failed. Schema of MV was renamed' AS text)
         WHEN a.status = -6
           THEN CAST('Refresh failed. A base table column was not found' AS text)
         WHEN a.status = -5
           THEN CAST('Refresh failed. A base table was renamed' AS text)
         WHEN a.status = -4
           THEN CAST('Refresh failed. A base table column type was changed' AS text)
         WHEN a.status = -3
           THEN CAST('Refresh failed. A base table column was dropped' AS text)
         WHEN a.status = -2
           THEN CAST('Refresh failed. MV was not found' AS text)
         WHEN a.status = -1
           THEN CAST('Refresh failed due to an internal error' AS text)
         WHEN a.status = 1
           THEN (CAST('Refresh successfully updated MV incrementally' AS text) || CASE
                                                                                    WHEN a.no_new_rows = CAST('t' AS bpchar)
                                                                                     AND a.skipped_rows = CAST('f' AS bpchar)
                                                                                      THEN CAST('. Stream returned no new data' AS text)
                                                                                    WHEN a.no_new_rows = CAST('t' AS bpchar)
                                                                                     AND a.skipped_rows = CAST('t' AS bpchar)
                                                                                      THEN CAST('. All records received from the stream were skipped' AS text)
                                                                                    WHEN a.no_new_rows = CAST('f' AS bpchar)
                                                                                     AND a.skipped_rows = CAST('t' AS bpchar)
                                                                                      THEN CAST('. Some stream records were skipped' AS text)
                                                                                    ELSE CAST('' AS text)
                                                                                  END) || CASE
                                                                                            WHEN a.may_have_more_rows = CAST('t' AS bpchar)
                                                                                              THEN CAST('. The stream may contain more data' AS text)
                                                                                            ELSE CAST('' AS text)
                                                                                          END
         WHEN a.status = 2
           THEN CAST('MV was already updated' AS text)
         WHEN a.status = 3
           THEN CAST('Refresh successfully recomputed MV from scratch' AS text)
         WHEN a.status = 4
           THEN CAST('Refresh could not update MV further due to an active transaction' AS text)
         WHEN a.status = 5
           THEN CAST('Refresh partially updated MV incrementally up to an active transaction' AS text)
         WHEN a.status = 6
           THEN CAST('Refresh partially recomputed MV from scratch up to an active transaction' AS text)
         WHEN a.status = 7
           THEN CAST('Auto refresh aborted due to excessive user workload' AS text)
         WHEN a.status = 8
           THEN CAST('MV was already updated, but depends on an MV that is not up to date.' AS text)
         WHEN a.status = 9
           THEN CAST('Refresh successfully updated MV incrementally, but MV depends on an MV that is not up to date.' AS text)
         WHEN a.status = 10
           THEN CAST('Refresh successfully recomputed MV from scratch, but MV depends on an MV that is not up to date.' AS text)
         WHEN a.status = 11
           THEN CAST('Auto refresh aborted due to conflicting user workload' AS text)
         WHEN a.status = 12
           THEN CAST('Refresh aborted' AS text)
         WHEN a.status = 13
           THEN CAST('A full recompute was successfully completed as a base table column was changed.' AS text)
         WHEN a.status = 14
           THEN CAST('A full recompute was successfully completed as VACUUM was ran on a base table.' AS text)
         WHEN a.status = 15
           THEN CAST('A full recompute was successfully completed as TRUNCATE was ran on a base table.' AS text)
         WHEN a.status = 16
           THEN CAST('A full recompute was successfully completed as DIST or SORT KEY was altered on a base table.' AS text)
         WHEN a.status = 17
           THEN CAST('A full recompute was successfully completed as DISTSTYLE of base table was updated internally.' AS text)
         WHEN a.status = 18
           THEN CAST('A full recompute was successfully completed as a base table was changed.' AS text)
         WHEN a.status = 19
           THEN CAST('A full recompute was successfully completed as a data file was deleted.' AS text)
         WHEN a.status = 20
           THEN CAST('A full recompute was successfully completed as the previous Iceberg snapshot expired.' AS text)
         WHEN a.status = 21
           THEN CAST('A full recompute was successfully completed as a base table is governed by a manifest.' AS text)
         WHEN a.status = 22
           THEN CAST('A full recompute was successfully completed as more than one base table was updated.' AS text)
         WHEN a.status = 23
           THEN CAST('A full recompute was successfully completed as the MV was already refreshed once in the current transaction.' AS text)
         WHEN a.status = 24
           OR a.status = 25
           OR a.status = 26
           OR a.status = 27
           THEN (CASE
                   WHEN a.status = 24
                     THEN CAST('Cascade automatic refresh skipped because materialized view ' AS text)
                   WHEN a.status = 25
                     THEN CAST('Cascade refresh skipped because materialized view ' AS text)
                   WHEN a.status = 26
                     THEN CAST('Cascade automatic refresh failed because materialized view ' AS text)
                   WHEN a.status = 27
                     THEN CAST('Cascade refresh failed because materialized view ' AS text)
                   ELSE CAST(NULL AS text)
                 END || COALESCE(failed_mv.mv_info,
                                 CAST('[unknown]' AS text))) || CAST(' was not refreshed.' AS text)
         ELSE CAST('Unknown refresh status' AS text)
       END AS status,
       a.refresh_type
FROM stl_mv_refresh AS a
     INNER JOIN pg_namespace AS b ON CAST(a.schemaoid AS oid) = b.oid
     INNER JOIN pg_class AS d ON CAST(a.mvoid AS oid) = d.oid
     INNER JOIN pg_database AS e ON CAST(a.db_oid AS oid) = e.oid
     LEFT JOIN (SELECT (CAST(ns.nspname AS text) || CAST('.' AS text)) || CAST(pc.relname AS text) AS mv_info,
                       smr.xid
                FROM stl_mv_refresh AS smr
                     INNER JOIN pg_class AS pc ON CAST(smr.mvoid AS oid) = pc.oid
                     INNER JOIN pg_namespace AS ns ON CAST(smr.schemaoid AS oid) = ns.oid
                WHERE smr.status < 0
                LIMIT 1) AS failed_mv ON a.xid = failed_mv.xid
                                     AND (a.status = 24
                                       OR a.status = 25
                                       OR a.status = 26
                                       OR a.status = 27)


Home 3D Друк Blog Bring-Up Times Cross-Region Benchmarks Email Forums Mailing Lists Redshift Price Tracker Redshift Version Tracker Replacement System Tables Reserved Instances Marketplace Slack System Table Tracker The Known Universe White Papers