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_%';

No comments:

Post a Comment