如何获取postgresql中的表总数? [英] How to get the total number of tables in postgresql?
本文介绍了如何获取postgresql中的表总数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有什么方法可以获得一个Postgresql数据库中的表总数?我使用的postgresql版本是PostgreSQL 8.4.14。
Is there any way by which I can get the total number of tables in a Postgresql database? The postgresql version I'm using is PostgreSQL 8.4.14.
推荐答案
select count(*)
from information_schema.tables;
或者,如果您想查找仅适用于特定模式的表数:
Or if you want to find the number of tables only for a specific schema:
select count(*)
from information_schema.tables
where table_schema = 'public';
这篇关于如何获取postgresql中的表总数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文