有人能让我知道如何检查亚马逊红移中的表依赖关系吗? 即我想删除我的主表并列出依赖于我的主表的所有其他表。
我正在检查下面的查询但是它没有按要求工作。
SELECT DISTINCT c_p.oid AS tbloid
,n_p.nspname AS schemaname
,c_p.relname AS NAME
,n_c.nspname AS refbyschemaname
,c_c.relname AS refbyname
,c_c.oid AS viewoid
FROM pg_class c_p
JOIN pg_depend d_p ON c_p.relfilenode = d_p.refobjid
JOIN pg_depend d_c ON d_p.objid = d_c.objid
JOIN pg_class c_c ON d_c.refobjid = c_c.relfilenode
LEFT JOIN pg_namespace n_p ON c_p.relnamespace = n_p.oid
LEFT JOIN pg_namespace n_c ON c_c.relnamespace = n_c.oid
WHERE d_c.deptype = 'i'::"char"
AND c_c.relkind = 'v'::"char"
AND c_p.relname = 'TV_input source'
非常感谢任何帮助。