在终端中放置`postgres -D/usr/local/var/postgres`时得到这个结果

lll*_*lll 4 postgresql osx-yosemite

当我放入postgres -D /usr/local/var/postgres终端时,我得到了回复:

日志:无法将主机名"localhost",服务"5432"转换为地址:提供的nodename或servname,或者未知
警告:无法为"localhost"创建监听套接字
FATAL:无法创建任何TCP/IP套接字

有人可以帮我解决这个问题吗?

hli*_*vac 9

检查/ etc/hosts文件中是否缺少行:

127.0.0.1 localhost.localdomain localhost

问候

H