简体   繁体   中英

Unable to Open Postgres shell in Mac Terminal ZSH

Disclaimer that I'm both new to Mac & Postgres. I recently got the 2020 MacBook Pro and have been setting it up for my personal [learning] development computer. In the process of attempting to install Postgres, I am having issues and am not sure what I am doing wrong / missing.

I've installed Postgres via Homebrew using:

brew install postgresql

All seems to have been installed fine, but whenever I try to open up a Postgres shell to enter commands into (coming from a Windows/Bash background), I keep getting the same response:

>> psql
[1] ##### killed      psql
>> psql postgres
[1] ##### killed      psql postgres
>> psql -U postgres
[1] ##### killed      psql -U postgres

When asking where psql is:

>> where psql
/opt/homebrew/bin/psql

When trying to make sure postgresql is launched I run as instructed in the brew installation output:

>> pg_ctl -D /opt/homebrew/var/postgres start

pg_ctl: directory "/opt/homebrew/var/postgres" is not a database cluster directory

And when attempting to check the Postgres version:

>> postgres -V

[1] ##### killed postgres -V

I am not sure what I'm missing and any help would be appreciated. I'm trying to set up Postgres so I can use it for an Angular tutorial I'm trying to understand. The backend connection has never been my strong-suit and I'm working to fix that.

I've had the same problem. Now there's a new version of Postgres that works (stable 13.3). Just upgrade the app via brew upgrade .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM