I'm trying to go through the book "7 Databases in 7 Weeks" and I'm completely stuck at starting a Postgres server.

My current issue is that when I run pg_ctl start I get the following error:

LOG:  database system was shut down at 2013-06-12 17:18:24 PDT
LOG:  invalid magic number 0000 in log file 0, segment 1, offset 0
LOG:  invalid primary checkpoint record
LOG:  invalid secondary checkpoint record
PANIC:  could not locate a valid checkpoint record
LOG:  startup process (PID 1454) was terminated by signal 6: Abort trap
LOG:  aborting startup due to startup process failure

I have no idea how to go about fixing this. I'm running PostgreSQL 9.2.4 on Mountain Lion 10.8.3.

  • How did you installed the DB server? Commented Jun 20, 2013 at 7:26
  • 1
    More important, what did you do prior startup? The error is that it is missing a WAL. Commented Jun 20, 2013 at 9:15
  • @dezso Installed with Homebrew. I had some issues with postgres finding the pgsql_socket and followed the first answer in this post to get it up and running, but that doesn't seem like it has to do with the error: dba.stackexchange.com/questions/21587/…
    – OdieO
    Commented Jun 20, 2013 at 16:13
  • @JimmyStenke: I had installed with the graphical installer from www.enterprisedb.com first, but had issues so used the uninstall app and then used Homebrew. The Homebrew install had the issues in my previous comment so I uninstalled the brew and then reinstalled the brew a couple times. When I finally got it working, the DB from the previous stall was still in /usr/local/var/postgres/ so I just used that.
    – OdieO
    Commented Jun 20, 2013 at 16:17
  • OK, I just deleted the old DB folder and recreated it, and it works. Thanks for pointing me in the right direcion @JimmyStenke.
    – OdieO
    Commented Jun 20, 2013 at 16:36

1 Answer 1


Per JimmyStenke's suggestion, I realized I had a DB initialized from a previous install, and it seems that was causing the error. I deleted it and initialized a new DB.

Not the answer you're looking for? Browse other questions tagged or ask your own question.