psql: symbol lookup error: ./psql: undefined symbol: PQsetErrorContextVisibility

原文stackoverflow:

https://stackoverflow.com/questions/44393800/dyld-lazy-symbol-binding-failed-symbol-not-found-pqseterrorcontextvisibility


On running

$ psql

I get this error

dyld: lazy symbol binding failed: Symbol not found: 
_PQsetErrorContextVisibility
Referenced from: /usr/local/bin/psql
Expected in: /usr/local/lib/libpq.5.dylib

dyld: Symbol not found: _PQsetErrorContextVisibility
Referenced from: /usr/local/bin/psql
Expected in: /usr/local/lib/libpq.5.dylib

Abort trap: 6

I have tried a few things:

  1. few posts suggested to update brew
  2. few suggested adding /usr/local/bin/psql to the ~/.bash_profile and restarting the system
  3. few said it was problem with XCode but I do not have XCode installed so it isnt valid for me I guess.

but none of it worked.

my bash_profile looks like this

PATH="/usr/local/bin/psql:/usr/local/sbin:/usr/local/bin:/sbin:/bin
:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin/geckodrive‌​r:$PATH"
export PATH

I am using:

  • psql (PostgreSQL) 9.6.2
  • macOS Sierra version 10.12.3

2 Answers

up vote 16 down vote accepted

I was on PostgreSQL 9.6.2 as well, and ran into the same problem.

I upgraded to 9.6.3 using brew like this:

rm '/usr/local/lib/libpq.5.dylib'
brew upgrade postgresql
brew link postgresql

It worked, and now I have access via psql again.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值