PostgreSQL Disk Space – How to Reset Database When Disk Space is Full

postgresqlpostgresql-8.4

I have a small ~10G PostgreSQL 8.4 database used for development that has filled up the /var directory and is now unusable. I am unable to connect to the database in this state to delete any data or drop any tables.

I am not concerned about keeping any of the data in the database, but I am unable to run a DROP DATABASE or similar command because I am unable to connect.

What is the best method for 'resetting' my database given this situation?

Best Answer

First I'd have a look around /var/log to see if there are any files I could get rid of. If that's the case, you could then start your service and remove the appropriate databases.

If you do not care of your data, you could drop your cluster with the pg_dropcluster command. Look at the man file for the appropriate options.

And by the way, 8.4 support has ended a while ago (https://www.postgresql.org/support/versioning/) and you shoudl really consider upgrading to a supported version.