Rozkalns
Rozkalns

Reputation: 512

Postgresql installed through Brew does not start automatically

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.

Upvotes: 5

Views: 6477

Answers (1)

Allan Mogusu
Allan Mogusu

Reputation: 240

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

Upvotes: 3

Related Questions