Function pg_schema_size
The function returns the size for schema given as parameter in bytes.
Examples
-- Returns the size of the schema public in bytes
SELECT pg_schema_size('public');
Result:
| pg_schema_size |
|---|
| 348536832 |
-- Returns the size of the schema public formatted
SELECT pg_size_pretty(pg_schema_size('public'));
Result:
| pg_schema_size |
|---|
| 332 MB |