简体   繁体   English

无法在 Mac 终端 ZSH 中打开 Postgres shell

[英]Unable to Open Postgres shell in Mac Terminal ZSH

Disclaimer that I'm both new to Mac & Postgres.免责声明我都是 Mac 和 Postgres 的新手。 I recently got the 2020 MacBook Pro and have been setting it up for my personal [learning] development computer.我最近购买了 2020 款 MacBook Pro,并一直在为我的个人 [学习] 开发计算机进行设置。 In the process of attempting to install Postgres, I am having issues and am not sure what I am doing wrong / missing.在尝试安装 Postgres 的过程中,我遇到了问题,并且不确定我做错了什么/遗漏了什么。

I've installed Postgres via Homebrew using:我已经通过 Homebrew 安装了 Postgres:

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:一切似乎都安装得很好,但是每当我尝试打开 Postgres shell 来输入命令(来自 Windows/Bash 背景)时,我都会得到相同的响应:

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

When asking where psql is:当询问 psql 在哪里时:

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

When trying to make sure postgresql is launched I run as instructed in the brew installation output:在尝试确保启动 postgresql 时,我按照 brew 安装 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 版本时:

>> 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.我正在尝试设置 Postgres,以便我可以将它用于我试图理解的 Angular 教程。 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).现在有一个新版本的 Postgres 可以工作(稳定版 13.3)。 Just upgrade the app via brew upgrade .只需通过brew upgrade升级应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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