Skip to content

Instantly share code, notes, and snippets.

@narendranathjoshi
Created April 9, 2020 02:19
Show Gist options
  • Save narendranathjoshi/a63bd456f991e52ea51c674b6d0adac4 to your computer and use it in GitHub Desktop.
Save narendranathjoshi/a63bd456f991e52ea51c674b6d0adac4 to your computer and use it in GitHub Desktop.
Count Rows in All Tables in PostgreSQL
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