mencari tabel berdasarkan schema & nama table
SELECT schemaname,tablename,hasindexes,tableowner
FROM pg_tables WHERE schemaname in ('npabp_department','npac')
and tablename like '%kkst%'
order by 1,2;
mencari tabel berdasarkan schema, type tabel, nama kolom
select t.table_schema,
t.table_name
from information_schema.tables t
inner join information_schema.columns c on c.table_name = t.table_name
and c.table_schema = t.table_schema
where c.column_name like '%address%'
and t.table_schema not in ('information_schema', 'pg_catalog')
and t.table_schema in ('region_nationwide')
and t.table_type = 'VIEW'
group by 1,2
order by t.table_schema;