title: PostgreSQL server wouldn't shutdown on Lion (Mac OS 10.7)
body: <p>I installed PostgreSQL using Homebrew on Lion. It starts okay but wouldn't shutdown. I tried:</p>
  
  <pre><code>$ #started with
  $ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
  $ #tried stoping with
  $ pg_ctl -D /usr/local/var/postgres stop -m immediate
  waiting for server to shut down................................... failed
  pg_ctl: server does not shut down
  </code></pre>
  
  <hr>
  
  <p>I fixed this issue by deleting the Launch Agent:</p>
  
  <pre><code>launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
  rm ~/Library/LaunchAgents/org.postgresql.postgres.plist
  </code></pre>