点击查看代码
SELECT n.nspname AS schema_name,c.relname AS table_name,d.description AS table_description
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_description d ON d.objoid = c.oid AND d.objsubid = 0
WHERE c.relkind = 'r' -- 只选择表(不包括视图、索引等)AND d.description LIKE '%人员上岗主表%' -- 替换为你的注释关键字
ORDER BY schema_name, table_name;