【发布时间】:2013-05-10 14:39:37
【问题描述】:
我在尝试将 postgresql 与 homebrew 一起使用时遇到问题。在进行完全干净的安装后(从 postgresql 9.1.3 升级到 9.2.4 并进行 MacOS X 的系统更新后),Lion 附带的 postgresql 似乎与 homebrew 提供的冲突。
冲突意味着当 OSX 启动时(以及使用 ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist),postgresql 在启动时无法正确加载,这会导致
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
错误。问题是,如果我随后手动加载和卸载 homebrew.mxcl.postgresql.plist 代理,postgresql 从此时开始工作,有谁知道如何解决这个问题(我认为这可能是 /usr/bin/ psql 和自制程序的 /usr/local/bin/psql)
编辑:在重新启动并运行 launchctl list | grep postgres 后,我得到了这个结果 680 - homebrew.mxcl.postgresql,运行 launchctl list | grep pg 什么也没有,出于某种奇怪的原因,它现在正在工作(即使我已经t 发布后更改任何内容)。将重新启动几次以弄清楚发生了什么
EDIT2:它现在似乎有效,我不知道为什么(昨晚浪费了大约 3 个小时),我将把它标记为已回答,直到它再次出现
【问题讨论】:
-
重启后运行
launchctl list | grep postgres和launchctl list | grep pg,看看是否正在加载另一个pg实例。如果是这样,sudo launchctl unload [paste its name here].plist它。 -
这似乎是 OSX 的东西。输入错误消息的最后一行将到达此处:stackoverflow.com/q/8465508/905902(以及其他)
标签: macos postgresql homebrew postgresql-9.2