📚 [Postgresql] MacOS 에 설치하기
Category: Postgresql | 📅 March 09, 2026
공식 홈페이지에 나온 방법으로 설치하다가 안되서 -_-;;;
Brew 로 설치하자
brew install postgresql
이러면 끝.
인줄 알았지? ㅋㅋ
환경 설치
터미널 열고.
$ initdb --locale=en_US.UTF-8 -E UTF-8 /opt/homebrew/var/postgresql@18
$ brew cleanup --prune-prefix
$ echo 'export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH"' >> ~/.zshrc
$ export LDFLAGS="-L/opt/homebrew/opt/postgresql@18/lib"
$ export CPPFLAGS="-I/opt/homebrew/opt/postgresql@18/include"
$ brew services start postgresql@18
이렇게 실행시키면 백그라운드에서 돌게 되는데 . 이게 싫으면
LC_ALL="en_US.UTF-8" /opt/homebrew/opt/postgresql@18/bin/postgres -D /opt/homebrew/var/postgresql@18
사실은 이 다음부터가 큰 문제다.
psql postgres 명령이 안되는 경우가 종종 발생하는데..
반드시 터미널을 종료한 후 재시작 하자. ( 아까 설정한 환경설정 파일 적용 )
💭 Reviews
아마도 제일 불편한 매뉴얼 중 하나일 듯.