2

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/[email protected]  

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).

1 Answer 1

9

I shared the procedure to investigate further and maybe solve the problem.

  1. Check the file /opt/homebrew/opt/postgresql@10/[email protected]. This path is given by the brew services command.
  2. Open the file and see where the log is written. In my case:
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/[email protected]</string>
  1. 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.
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.