Created
August 16, 2018 21:07
-
-
Save paulomcnally/4bfc2f10b272083faea767d046a69f0b to your computer and use it in GitHub Desktop.
Contador de tablas por esquema en PostgreSQL
This file contains hidden or 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 | |
| count(*) AS "tables", schemaname | |
| FROM | |
| pg_tables | |
| WHERE | |
| schemaname | |
| IN | |
| ( | |
| SELECT | |
| nspname | |
| FROM | |
| pg_catalog.pg_namespace | |
| WHERE | |
| nspname | |
| NOT IN( | |
| 'pg_toast', | |
| 'pg_temp_1', | |
| 'pg_toast_temp_1', | |
| 'pg_catalog', | |
| 'information_schema', | |
| 'shared_extensions' | |
| ) | |
| ) | |
| GROUP BY | |
| schemaname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment