We help IT Professionals succeed at work.

How do I determine the database size of a postgresql db?

ptansey
ptansey asked
on
1,772 Views
Last Modified: 2012-06-22
I am running a software package that uses postgresql 8.1.4 on RHEL to track delta changes. I know very little about postgresql other than how to install it.

My postgresql \var\lib\pgsql\data directory has grown to 57GBs and used up all available disk space on my machine, causing the software to fail.

How can I determine which of the 3 databases my software uses is the large one? Is there a command that will help me determine database size?

This is a critical issue effecting production servers, so immediate assistance would most appreciated.
Comment
Watch Question

Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
DRHF: your post actually solved my root problem - thank you. However, it didn't answer my question of how to determine the dbsize.

EARTHMAN2: thank you for trying to answer the dbsize question - I'm still trying to get contrib/oid2name to work, it looks like the answer, but I'm missing some libs.The pg_database_size statement may not work in all versions of postgresql, I get an error when running it:

Function pg_database_size("unknown") does not exist

I appreciate both of your efforts and expertise on this issue. thanks again.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.