Download the new postgresql version
untar , then
./configure
make
Stop the old server
sudo /usr/local/pgsql/bin/pgsql.sh stop
Move the old server directory
mv /usr/local/pgsql /usr/local/pgsql-9.1.24
Now install the new server
make install
cd into the contrib/pg_upgrade directory.
make
make install
cd into the contrib/pg_upgrade_support directory.
make
make install
run the following, changing the directories to be the correct ones. old => new
su postgres
Create the new data directory
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_upgrade -b /usr/local/pgsql-9.1.24/bin/ -B /usr/local/pgsql/bin/ -d /usr/local/pgsql-9.1.24/data -D /usr/local/pgsql/data
Copy the pgsql.sh file to the new bin location.
cp /usr/local/pgsql-9.1.24/bin/pgsql.sh /usr/local/pgsql/bin/
mkdir /usr/local/pgsql/log
chown postgres:postgres /usr/local/pgsql/log
edit the pg_hba.conf file and add the following to the end
# Allow any user from host 192.168.1.x to connect to
# any database if the user's password is correctly supplied.
# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.1.0/24 md5
start the server again.