5

Story:

I installed postgresql using brew a while ago, but I haven't found a solution that it would start automatically on the startup. Do you have any solution?

Issue:

enter image description here

this is what I see when I try to connect to local database.

What I've tried:

This is $ brew services list output (single line)

postgresql started root /Library/LaunchDaemons/homebrew.mxcl.postgresql.plist

When installed, I followed instructions to start it now and after restart at login

Workaround:

Only workaround is to run this line

pg_ctl -D /usr/local/var/postgres start which is quite inconvenient since I have to look it up in info page or assign to alias which I can't remember each time when I restart the computer.

2
  • Have you tried brew services start postgresql? That should automatically start the service after a restart. Commented Apr 19, 2018 at 8:16
  • @jdno yes, this is the command that added the row to the services list. Tried both with and without sudo. Commented Apr 19, 2018 at 8:41

1 Answer 1

3

I realized most of these issues when my mac shutdown. To solve this, you may try this:

  1. On your terminal run:  postgres -D /usr/local/var/postgres
  2. Copy the PID returned and then run; kill -9 <PID>
  3. Finally, run brew services restart postgres. That should do it for most of the cases
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.