I try to setup postgress in OS X Lion, and find that is not correctly setup the LOCALE environment var.
This is what is set:
LANG= LC_COLLATE=\"C\" L
I recently had the same issue on OS X Sierra with bash shell, and thanks to answers above I only had to edit the file
~/.bash_profile
and append those lines
export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8