Showing posts with label postgres rows count all tables. Show all posts
Showing posts with label postgres rows count all tables. Show all posts

Thursday, 4 July 2013

Postgres - SQL to get rows count for all tables

SELECT relname, n_tup_ins - n_tup_del as rowcount FROM pg_stat_all_tables where (n_tup_ins - n_tup_del) > 0 AND relname NOT LIKE 'pg_%';