Created
July 30, 2012 08:12
-
-
Save manuelvanrijn/3205631 to your computer and use it in GitHub Desktop.
SELECT total_rows FROM postgres_database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SUM(pgClass.reltuples) AS totalRowCount | |
FROM | |
pg_class pgClass | |
LEFT JOIN | |
pg_namespace pgNamespace ON (pgNamespace.oid = pgClass.relnamespace) | |
WHERE | |
pgNamespace.nspname NOT IN ('pg_catalog', 'information_schema') AND | |
pgClass.relkind='r' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment