Skip to content

Instantly share code, notes, and snippets.

@amccartney
Created April 4, 2017 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amccartney/902f386a2f419e4e84d349ae5be0d069 to your computer and use it in GitHub Desktop.
Save amccartney/902f386a2f419e4e84d349ae5be0d069 to your computer and use it in GitHub Desktop.
Row count for all tables in a postgres database
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment