查询当前数据库下所有表的数据量,后来改成了通过sql拼接sql语句来查询。
SELECT concat('select ''',tablename,''' as table_name,count(1) as sum from ',tablename,' union all') FROM pg_tables where schemaname = 'XXX'
其中XXX是你需要查询的schema,然后再复制上面sql的查询结果,删掉最后一行的union all执行即可。
标签:postgresql,union,XXX,tablename,查询,sql,schema From: https://www.cnblogs.com/chenghu/p/17201210.html原文:https://blog.csdn.net/yangguang_98/article/details/121330066