Skip to content

Instantly share code, notes, and snippets.

@benjaminoakes
Created March 30, 2017 18:39
Show Gist options
  • Save benjaminoakes/ef04136dd727e9cb9866a40154b5165c to your computer and use it in GitHub Desktop.
Save benjaminoakes/ef04136dd727e9cb9866a40154b5165c to your computer and use it in GitHub Desktop.
Count all tables (Postgres)
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