Postgresql – Update server version for postgres 9.1.2

postgresql

I'm trying to run a postgis sql script and I'm running into the following error.
Am I correct to say that updating my server version will fix it? If so, how can I go about updating it?

I'm on Mac OSX Lion and installed Postgres via brew. Apparently I have an older version installed which is 9.1.2 but installing postgis installed postgres 9.2.1 on to my system. How can I point my postgres server to the new one?

nai@nyc /usr/local/share/postgis (git::master) $ psql -d template_postgis -f postgis.sql
SET
BEGIN
psql:postgis.sql:49: ERROR:  incompatible library "/usr/local/Cellar/postgresql/9.2.1/lib/postgis-2.0.so": version mismatch
DETAIL:  Server is version 9.1, library is version 9.2.


nai@nyc /usr/local/share/postgis (git::master) $ psql
psql (9.2.1, server 9.1.2)
WARNING: psql version 9.2, server version 9.1.
         Some psql features might not work.

Best Answer

My fix:

brew uninstall postgresql --force

I had previous versions of postgres floating around.

brew uninstall postgis

brew install postgis