calculating schema size in postgresql

This commit is contained in:
Morgan 2020-05-15 14:52:59 +02:00 committed by GitHub
parent e0f8595e00
commit bbefa69b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,11 @@
`\dn`
### Gets the size of a schema
```
SELECT pg_size_pretty(SUM(pg_total_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::BIGINT) FROM pg_tables WHERE schemaname = 'schema_name'
```
### Return back to shell
`\q`