title: cannot restart postgres on mac os x
body: <p>I cannot restart the postgres server on Mac OS X.
  How can I fix this?</p>
  
  <p>Tried two ways:</p>
  
  <p>pg_ctl restart returns:</p>
  
  <pre><code>pg_ctl: PID file "usr/local/var/postgres:/postmaster.pid" does not exist
  Is server running?
  starting server anyway
  pg_ctl: could not read file "usr/local/var/postgres:/postmaster.opts"
  </code></pre>
  
  <p>The server does not restart</p>
  
  <p>pg_ctl -D /usr/local/var/postgres restart results in:</p>
  
  <pre><code>   pg_ctl: PID file "/usr/local/var/postgres/postmaster.pid" does not exist
     Is server running?
     starting server anyway
     server starting
     LOG:  could not bind IPv4 socket: Address already in use
     HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
     LOG:  could not bind IPv6 socket: Address already in use
     HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
     WARNING:  could not create listen socket for "*"
     FATAL:  could not create any TCP/IP sockets
  </code></pre>