Redshift Research Project

System Table Tracker

System view pg_catalog.pg_table_def version 1.0.39009 / 2022-06-08

schema name column data type
pg_catalog pg_table_def column name
pg_catalog pg_table_def distkey bool
pg_catalog pg_table_def encoding char(32)
pg_catalog pg_table_def notnull bool
pg_catalog pg_table_def schemaname name
pg_catalog pg_table_def sortkey int4
pg_catalog pg_table_def tablename name
pg_catalog pg_table_def type text

View Text

SELECT n.nspname AS schemaname,
       c.relname AS tablename,
       a.attname AS "column",
       format_type(a.atttypid, a.atttypmod) AS type,
       format_encoding(CAST(a.attencodingtype AS integer)) AS encoding,
       a.attisdistkey AS distkey,
       a.attsortkeyord AS sortkey,
       a.attnotnull AS "notnull"
FROM pg_namespace AS n, pg_class AS c, pg_attribute AS a
WHERE n.oid = c.relnamespace
  AND c.oid = a.attrelid
  AND a.attnum > 0
  AND NOT a.attisdropped
  AND pg_table_is_visible(c.oid)
  AND (c.relkind = CAST('r' AS "char")
    OR c.relkind = CAST('v' AS "char"))
ORDER BY n.nspname,

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