Redshift Research Project

System Table Tracker

System view information_schema.column_udt_usage version 1.0.67699 / 2024-05-26

schema name column data type
information_schema column_udt_usage column_name sql_identifier
information_schema column_udt_usage table_catalog sql_identifier
information_schema column_udt_usage table_name sql_identifier
information_schema column_udt_usage table_schema sql_identifier
information_schema column_udt_usage udt_catalog sql_identifier
information_schema column_udt_usage udt_name sql_identifier
information_schema column_udt_usage udt_schema sql_identifier

View Text

SELECT CAST(current_database() AS information_schema.sql_identifier) AS udt_catalog,
       CAST(COALESCE(nbt.nspname, nt.nspname) AS information_schema.sql_identifier) AS udt_schema,
       CAST(COALESCE(bt.typname, t.typname) AS information_schema.sql_identifier) AS udt_name,
       CAST(current_database() AS information_schema.sql_identifier) AS table_catalog,
       CAST(nc.nspname AS information_schema.sql_identifier) AS table_schema,
       CAST(c.relname AS information_schema.sql_identifier) AS table_name,
       CAST(a.attname AS information_schema.sql_identifier) AS column_name
FROM pg_attribute AS a,
     pg_class AS c,
     pg_namespace AS nc,
     pg_user AS u,
     pg_type AS t
     INNER JOIN pg_namespace AS nt ON t.typnamespace = nt.oid
     LEFT JOIN (pg_type AS bt
                INNER JOIN pg_namespace AS nbt ON bt.typnamespace = nbt.oid)
        ON t.typtype = CAST('d' AS "char")
       AND t.typbasetype = bt.oid
WHERE a.attrelid = c.oid
  AND a.atttypid = t.oid
  AND u.usesysid = COALESCE(bt.typowner, t.typowner)
  AND nc.oid = c.relnamespace
  AND a.attnum > 0
  AND NOT a.attisdropped
  AND (c.relkind = CAST('r' AS "char")
    OR c.relkind = CAST('v' AS "char"))
  AND u.usename = CAST("current_user"() AS name)

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