How do you find the row count for all your tables in Postgres

前端 未结 15 2244
无人及你
无人及你 2020-11-22 12:31

I\'m looking for a way to find the row count for all my tables in Postgres. I know I can do this one table at a time with:

SELECT count(*) FROM table_name;
         


        
15条回答
  •  执念已碎
    2020-11-22 13:22

    This worked for me

    SELECT schemaname,relname,n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC;

提交回复
热议问题