I'm currently running a OS X Lion Server system which ships with a built-in and not-upgradable PostgreSQL version. After years of usage I've finnaly decided to leave the built-in version and install an indipendent version. I disabled the built-in installation and downloaded the installer from EDB and followed the wizard. After many issues reguarding encoding and locales, I've finally managed how to setup a DB with no locale and UTF8 encoding. I issued the following command:
initdb -D /path/to/data --no-locale --encoding=UTF8
If I connect using pgAdminIII I get no problems. The command
show client_encoding; displays
UNICODE as the encoding used by pgAdminIII (the default installation gave me a
SQL_ASCII encoding and that's why I run the
The problem is that I'm not able to connect to PostgreSQL using
psql. Whatever I pass to it, I get the following error:
psql: invalid connection option "client_encoding"
I've searched through the Internet but found nothing that solves my problem (for example issuing
env PGCLIENTENCODING=UTF8 and adding
otool -L /Library/PostgreSQL/9.4/bin/psql returns:
/Library/PostgreSQL/9.4/bin/psql: @loader_path/../lib/libpq.5.dylib (compatibility version 5.0.0, current version 5.7.0) @loader_path/../lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0) @loader_path/../lib/libedit.0.dylib (compatibility version 1.0.0, current version 1.48.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
Anyone can help me to figure it out?
Many thanks to all Pietro
I forgot to logout and then login after editing the bash profile. The suggestion made by Daniel Vérité was right. I just edited the
DYLD_LIBRARY_PATH env variable in
/etc/profile in order to make it visible at a global level and not only from the interactive shell.
I added the following line to
I hope this helps others.
Daniel, Thank you a lot