How to get the total number of tables in postgresql?

ぃ、小莉子 提交于 2019-12-03 22:04:47
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';

Just try to search in pg_stat... tables or information_schema you can find there very useful informations about your database.
Example:

select * from  pg_stat_user_tables ;
select count(*) from  pg_stat_user_tables ; 
select * from  pg_stat_all_tables ;
pipaliya uttam
select Count(*) from sys.tables
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!