Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been working with postgres on a linux server for the last couple of months. Last week, half of our servers crashed and my one with them. I was in the middle of uploading data to the postgres database with osm2pgsql when this happened. After we revived the server, postgres has stopped working.


service postgresql start
(Alternatively, /etc/rc.d/init.d/postgresql start, same thing happens)
Starting postgresql service:  [  OK  ]

service postgresql status

postmaster dead but pid file exists

Trying to start the postmaster using

su postgres
postmaster -D /var/lib/pgsql/data

yields nothing either.

As for the pid file, /var/run/ exists, and when I remove it then the status changes to "postmaster is stopped", but if I try to start it again:

service postgresql start
Starting postgresql service: [FAILED]

If anyone has any idea what I could do to get it working, where the problem might be. What really gets me is that it was working until last week, I even rebooted a backup and nothing seems to have changed, I'm really at my wit's end with this problem!

share|improve this question

migrated from Jun 2 '13 at 16:37

This question came from our site for professional and enthusiast programmers.

Stop! step away from! Don't do anything more right now. – Craig Ringer Jun 2 '13 at 12:21
Other detail you need to provide: The file system in use; the type of disk storage on the server; details of the disk models if you're using SSDs; if you're using hardware RAID, whether write-back caching was enabled; whether you're using LVM; whether you're using software RAID; if you're using ext3/ext4, what mount options you're using; etc – Craig Ringer Jun 2 '13 at 12:30
Finally, while it's likely nothing's wrong, depending on a lot of the details we don't have yet you should assume DB corruption until you know otherwise. Read: – Craig Ringer Jun 2 '13 at 12:33
When the server quits immediately, it normally leaves some error messages in the server log, which is syslog or a file depending on the configuration. You need to consult this log. – Daniel Vérité Jun 2 '13 at 21:05

When I faced this message, I checked the postgresstartup.log, it showed that the data directory was having permissions as 777,After I changed to 700 , the postgresql started working

sudo su - postgres

chmod 700 -R <postgresql_Data_Directory>


/etc/init.d/postgresql start

/etc/init.d/postgresql status
share|improve this answer
I strongly doubt this would solve the problem the asker was having. – Colin 't Hart Dec 16 '14 at 10:55

Check the server.log. That normally indicates why the issue is happening. I have faced the same issue and I could see that it was unable to find var/postgres/ etc.

I am using Mac so I used the following commands and it came back again. But I lost my data folder.

brew uninstall postgres
brew install postgres
initdb `brew --prefix`/var/postgres/data -E utf8``
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.