I installed postgresql 10 with the classic command:
brew install postgresql@10
Then I started the service:
brew services start postgresql@10
The output says:
Successfully started postgresql@10 (label: homebrew.mxcl.postgresql@10)
but when I run this command:
brew services
This is what I get:
Name Status User Plist
cassandra stopped
postgresql stopped
postgresql@10 error username /opt/homebrew/opt/postgresql@10/homebrew.mxcl.postgresql@10.plist
It seems that the service in not running correctly. Previously I had another version of Posgresql. It was the version 10 again but installed with the installer offered but the postgresql's webpage. However I should have removed it.
I check with this command to see used ports:
lsof -nP c 15 | grep LISTEN
and I don't have services using the port 5432 (the default port used by postgresql).
CodePudding user response:
I shared the procedure to investigate further and maybe solve the problem.
- Check the file
/opt/homebrew/opt/postgresql@10/[email protected]
. This path is given by thebrew services
command. - Open the file and see where the log is written. In my case:
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/postgresql@10.log</string>
- Look at the log. I my case I saw that there was a file locked, probably by the previous instance of postgresql that didn't release the lock. The restart of my Mac solved the issue.