I know there are a lot of lion-postgresql related questions on stack overflow already, but none seem to solve my problem.

I installed the homebrew of postgresql and everything was fine after that. Then I messed around a bit with the the libpq.dylib link in /usr/lib so that an application would link to the brew installed version rather than the OS-installed version. Somehow I managed to break my install while doing this in such a way that any call to psql gives the following error:

>psql
psql: invalid connection option "client_encoding"

reinstalling postgresql with 'brew remove postgresql' and another 'brew install postgresql' doesn't seem to help (same error). I've also relinked /usr/lib/libpq.dylib to be /usr/lib/libpq.5.dylib, which is what I believe it was before.

Also, a potentially related problem is that my postgres server doesn't seem to want to shut down:

>pg_ctl -D /usr/local/var/postgres stop -s -m fast     
pg_ctl: server does not shut down

Anyone have any clues as to what is wrong? Alternatively, how would I completely uninstall and reinstall the postgres server and client?

Edit
Report