Redshift Observatory

System Table Tracker

System view pg_catalog.svv_tables version 1.0.48714 / 2023-04-06

schema name column data type
pg_catalog svv_tables remarks varchar(256)
pg_catalog svv_tables table_catalog varchar(128)
pg_catalog svv_tables table_name varchar(128)
pg_catalog svv_tables table_schema varchar(128)
pg_catalog svv_tables table_type varchar(15)

View Text

SELECT CAST(current_database() AS varchar(128)) AS table_catalog,
       CAST(nc.nspname AS varchar(128)) AS table_schema,
       CAST(c.relname AS varchar(128)) AS table_name,
       CAST(CASE
              WHEN nc.nspname ~~ like_escape(CAST('pg!_temp!_%' AS text),
                                             CAST('!' AS text))
                THEN CAST('LOCAL TEMPORARY' AS text)
              WHEN c.relkind = CAST('r' AS "char")
                THEN CAST('BASE TABLE' AS text)
              WHEN c.relkind = CAST('v' AS "char")
                THEN CAST('VIEW' AS text)
              ELSE CAST(NULL AS text)
            END AS varchar) AS table_type,
       CAST(d.description AS varchar) AS remarks
FROM pg_namespace AS nc
     INNER JOIN pg_class AS c ON c.relnamespace = nc.oid
     INNER JOIN pg_user AS u ON u.usesysid = c.relowner
     LEFT JOIN pg_description AS d ON c.oid = d.objoid
                                  AND d.objsubid = 0
WHERE c.relkind = CAST('r' AS "char")
   OR c.relkind = CAST('v' AS "char")

UNION ALL

SELECT CAST(current_database() AS varchar(128)) AS table_catalog,
       svv_external_tables.schemaname AS table_schema,
       svv_external_tables.tablename AS table_name,
       'EXTERNAL TABLE' AS table_type,
       CAST(NULL AS unknown) AS remarks
FROM svv_external_tables


Home 3D Друк Blog Bring-Up Times Consultancy Cross-Region Benchmarks Email Forums IRC Mailing Lists Reddit Redshift Price Tracker Redshift Version Tracker Redshift Workbench System Table Tracker The Known Universe Twitter White Papers