Find dependent Tables for a postgres table.

If you want to find all dependent tables for a postgres table, use the code block bellow
Replace [YOURTABLENAME] with actual table name.

select distinct rwr_cl.relname dep_name  
      from pg_depend dep
      join pg_class ref_cl on dep.refobjid = ref_cl.oid
      join pg_namespace ref_nsp on ref_cl.relnamespace = ref_nsp.oid
      join pg_rewrite rwr on dep.objid = rwr.oid
      join pg_class rwr_cl on rwr.ev_class = rwr_cl.oid
      join pg_namespace rwr_nsp on rwr_cl.relnamespace = rwr_nsp.oid
      where dep.deptype = 'n'
      and dep.classid = 'pg_rewrite'::regclass
and ref_cl.relname = '[YOUR_TABLE_NAME]'  
limit 100  

It is useful for dropping and altering views which has dependant tables to be dropped first.