我正在使用 OS X El Capitan 版本 10.11.3 我下载了 Postgres 应用程序并运行了该应用程序。
顶部的大象图标显示版本 9.6.1.0(9.6.1.0)
当我单击“打开 psql”时,我的终端上会出现以下输出。
$ '/Applications/Postgres.app/Contents/Versions/9.6/bin'/psql -p5432
psql: FATAL: role <username> does not exist
我的用户名在哪里。据我了解,该应用程序应该使用我的用户名和无密码创建一个角色。
我试着做:
psql -h localhost -U <username>
这给出了同样的错误。
以下是我在尝试 SO 上发布的答案时得到的各种输出。
$ which psql
/Applications/Postgres.app/Contents/Versions/latest/bin/psql
在搜索了更多之后,我运行了以下命令:
psql -h localhost -U postgres
postgres=#
postgres 外壳打开了。谁能解释发生了什么?