I had the pleasure to battle a little with postgresql installed by Alfresco installers. What I found out is that Alfresco tends to change the software; mainly the location of files, scripts and used libraries ... they probably have good reasons to do this, to ensure consistency across installations, but this makes it hard to follow standard software procedures ...
For the postgresql installation, what you need to know is that the original postgresql binary are renamed/postfixed with '.bin', EX: pg_ctl -> pg_ctl.bin ... and a new script file has been added called pg_ctl, which calles the original and ensures its environment.
After using some time on that, I found two ways to tackle that:
- pg_upgrade, which needs clean version, so compile clean versions corresponding to the new and old postgresqls following this guide, using http://www.openscg.com/2013/04/how-to-compile-postgresql-9-2-x-from-source-on-ubuntu-12-x/ - however setting different prefixes in configure, EX: --prefix /usr/local/postgresql-9.2.4
- use the guide here https://www.fossoffice.com/blog/2012/12/13/alfresco-community-4-0-e-to-4-2-c-upgrade-procedure/ - I skipped the lucene part switch
I ended up doing the latter, because i ran into the xlog problems with a seemingly dirty db, like: http://www.brentmc79.com/posts/psql-could-not-connect-oh-fuck-you