# 버전 확인
$ postgres -V
버전은 14.5 였습니다.
api 작업을 하기 위해서 postgresql에 접속해려고하는데 아래와 같은 오류가 발생 !
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL: database does not exist
내부 postmaster.pid 파일이 발생시키는 Process 충돌 때문!!
(나를 괴롭히지마.. 😂)
# 1. postgres 서버 종료
$ brew services stop postgresql
# 2. pid 삭제
$ rm /opt/homebrew/var/postgres/postmaster.pid
# 3. postgres 서버를 재실행
$ brew services start postgresql
위 방법으로는 해결되지 않았습니다..
# 종료
$ brew services stop postgresql
# 삭제
$ brew uninstall --force postgresql
# postgresql 관련 파일들 삭제
$ rm -rf /opt/homebrew/var/postgres && rm -rf .psql_history .psqlrc .psql.local .pgpass .psqlrc.local
$ brew cleanup
# 삭제 확인
$ brew list | grep sql
# 재설치
$ brew install postgresql
# 서비스 시작
$ brew services start postgresql
# 접속
$ psql postgres
이후 설치된 버전은 14.6! 업그레이드 했을 때 최신버전이라고 했었는데.. 잘 모르겠습니다.😂
다른 블로그를 확인했을 때 13버전으로 했을 때 된다고 한 글도 봤었는데, 그것도 되진 않았었고.. 그냥 최신 버전으로 다운받으니 됐다. 처리했지만 처리하지 않은 느낌 휴