2

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?

3
  • Can't you delete (or temporarily move elsewhere) any other files in the /var partition (e.g. files from /var/log), or alternatively extend the partition (e.g. via LVM)? Once you make enough free space, you could start the service and drop stuff. Commented Jun 9, 2016 at 6:25
  • @ZiggyCrueltyfreeZeitgeister /var/log/ is actually mounted on a separate partition so deleting those logs will not help. I'm not sure what else in /var/ I can safely delete. Commented Jun 9, 2016 at 13:28
  • I am unable to connect: it's not clear whether your instance is running. If it refuses to start it might help to start in single user mode. If it's already started please share the error messages when trying to connect to it. Commented Jun 9, 2016 at 15:40

1 Answer 1

1

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.

1
  • I resolved this problem by temporarily moving some files from /var/ to another partition. Then I was able to start the database, connect, and drop my tables. Thanks for the help. Commented Jun 9, 2016 at 16:09

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.