select b.oid, b.relname, att.attname, b.relkind,attinhcount, atttypmod
from pg_attribute att, pg_class b
where b.oid = att.attrelid
and att.attname = 'column_name' --可以模糊查询 '%column_name%'
and attinhcount in (0)
and b.relkind in ('r')
order by b.relname, atttypmod;
postgresql查询所有表中是否存在某个字段
最新推荐文章于 2024-04-16 09:38:11 发布