最近,因为项目重构,需要统计老项目的数据库表中包含业务属性的某个字段,涉及到有哪些表;
所以,总结如下:
select distinct relname,attname
from pg_attribute att, pg_class b
where b.oid = att.attrelid
and att.attname like'%nick' --可以模糊查询 '%nick%'
and attinhcount in (0)
and b.relkind in ('r')
order by b.relname;
网友评论