Skip to content

Instantly share code, notes, and snippets.

@zakgrant
Created November 28, 2012 09:47
Show Gist options
  • Save zakgrant/4160190 to your computer and use it in GitHub Desktop.
Save zakgrant/4160190 to your computer and use it in GitHub Desktop.
Postgres non system table row count
SELECT relname, n_tup_ins - n_tup_del as rowcount
FROM pg_stat_all_tables
WHERE relname NOT LIKE 'pg_%'
AND relname NOT LIKE 'sql_%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment