Redshift Research Project

System Table Tracker

System view information_schema.constraint_table_usage version 1.0.41465 / 2022-09-10

schema name column data type
information_schema constraint_table_usage constraint_catalog sql_identifier
information_schema constraint_table_usage constraint_name sql_identifier
information_schema constraint_table_usage constraint_schema sql_identifier
information_schema constraint_table_usage table_catalog sql_identifier
information_schema constraint_table_usage table_name sql_identifier
information_schema constraint_table_usage table_schema sql_identifier

View Text

SELECT CAST(current_database() AS information_schema.sql_identifier) AS table_catalog,
       CAST(nr.nspname AS information_schema.sql_identifier) AS table_schema,
       CAST(r.relname AS information_schema.sql_identifier) AS table_name,
       CAST(current_database() AS information_schema.sql_identifier) AS constraint_catalog,
       CAST(nc.nspname AS information_schema.sql_identifier) AS constraint_schema,
       CAST(c.conname AS information_schema.sql_identifier) AS constraint_name
FROM pg_constraint AS c, pg_namespace AS nc, pg_class AS r, pg_namespace AS nr, pg_user AS u
WHERE c.connamespace = nc.oid
  AND r.relnamespace = nr.oid
  AND ((c.contype = CAST('f' AS "char")
    AND c.confrelid = r.oid)
    OR ((c.contype = CAST('p' AS "char")
      OR c.contype = CAST('u' AS "char"))
    AND c.conrelid = r.oid))
  AND r.relkind = CAST('r' AS "char")
  AND r.relowner = u.usesysid
  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