Last active
February 7, 2018 16:14
-
-
Save mccun934/881d4de085c44d370c70a9332f19a518 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
SIZES="SELECT relname AS objectname, | |
relkind AS objecttype, | |
reltuples AS "entries", pg_size_pretty(relpages::bigint*8*1024) AS size | |
FROM pg_class | |
WHERE relpages >= 8 | |
ORDER BY relpages DESC;" | |
echo $SIZES | sudo -i -u postgres psql -d foreman |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment