SELECT
relname AS TABLE_NAME,
reltuples AS rowCounts,
cast(obj_description(relfilenode,'pg_class') as varchar) as comment
FROM
pg_class
WHERE
relkind = 'r'
AND relnamespace = ( SELECT oid FROM pg_namespace WHERE nspname = 'public' )
AND relname not like '%copy%'
ORDER BY
rowCounts DESC;
pgsql 查询数据库各个表的数据量
最新推荐文章于 2024-09-19 11:27:56 发布
该SQL查询从pg_class系统表中检索公共命名空间内非COPY类型的表名、行数以及表的注释,按行数降序排列。
摘要由CSDN通过智能技术生成