I have installed postgresql@14 via brew on my Mac M2.
Now, when I do brew services
I get this output
postgresql@14 error 256 headmaster ~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist
Can anyone help and tell me, how to check where the actual error is?
UPD1
Based on code error 256 found some info with command tail -f /opt/homebrew/var/log/postgresql@14.log
2022-11-26 12:05:14.229 +03 [2139] LOG: starting PostgreSQL 14.6 (Homebrew) on aarch64-apple-darwin22.1.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.202), 64-bit
2022-11-26 12:05:14.231 +03 [2139] LOG: could not bind IPv6 address "::1": Address already in use
2022-11-26 12:05:14.231 +03 [2139] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2022-11-26 12:05:14.231 +03 [2139] LOG: could not bind IPv4 address "127.0.0.1": Address already in use
2022-11-26 12:05:14.231 +03 [2139] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2022-11-26 12:05:14.231 +03 [2139] WARNING: could not create listen socket for "localhost"
2022-11-26 12:05:14.231 +03 [2139] FATAL: could not create any TCP/IP sockets
2022-11-26 12:05:14.232 +03 [2139] LOG: database system is shut down
UPD2
based on the error log I checked my etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section
Not sure, if I should change anything here