PostgreSQL – pg_ctl: invalid data in PID file

postgresql


One fine day, when restarting PostgreSQL :

/usr/local/etc/rc.d/postgresql restart

it complained that

pg_ctl: invalid data in PID file "/postgres/directory/postmaster.pid"

postmaster.pid was the process ID file for PostgreSQL, which indicate PostgreSQL process. If the file exists, it would mean that PostgreSQL is alive and running. If it doesn’t, it would (of cause) mean PostgreSQL have been terminated, either on purpose or abnormally.



In this case, the file exist but the PostgreSQL instance is not running. After looking at the file, it was empty, no indication of process ID or whatsoever digit to describe the process. This lead to the conclusion of have been terminated abnormally, leaving an empty postmaster.pid.


The solution to this scenario would be manually removing the postmaster.pid file at /postgres/directory/postmaster.pid and start it again, then it should be fine.


Voilla !!!

More post - related

Please sponsor my coffee if you find my posts worth reading, thanks!

One Trackback

  1. By invalid data - StartTags.com on January 29, 2010 at 07:03

    [...] buyer tries to log into PayPal – error message is displayed This session contains invalid data …PostgreSQL pg_ctl: invalid data in PID file | Scratching My …One fine day, when restarting PostgreSQL : /usr/local/etc/rc.d/postgresql restart it complained that [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
-->
Improve the web with Nofollow Reciprocity.