Project

General

Profile

PostgreSQL upgrade on stkensrv3n

# Stop crond service
[root] /sbin/service crond stop
[enstore] /sbin/service crond status

# Identify and kill any potentially interfering processes
[enstore] ps aux | egrep 'postmaster|postgres|backup|checkdb'

# Uninstall 9.2
[root] yum remove pgdg-sl92 postgresql92 postgresql92-libs
[enstore] rpm -qa | grep postgresql92 | sort

# Install 9.3
[root] rpm --nodeps -ivh http://yum.postgresql.org/9.3/redhat/rhel-5-x86_64/pgdg-sl93-9.3-1.noarch.rpm
[root] yum -y --enablerepo=epel install uuid
[root] yum -y install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server postgresql93-contrib
[enstore] rpm -qa | grep postgresql93 | sort

# Setup alternatives (only as needed)
[root]
VER="9.3" 
for PROG in "initdb" "pg_ctl" "pg_config" "postmaster"; do
  # Configure program:
  rm -f /var/lib/alternatives/pgsql-${PROG};
  /usr/sbin/alternatives --install /usr/bin/${PROG} pgsql-${PROG} /etc/alternatives/pgsql-${PROG} 920 --slave /etc/alternatives/pgsql-${PROG} pgsql-${PROG} /usr/pgsql-${VER}/bin/${PROG};
  # Configure man page:
  rm -f /var/lib/alternatives/pgsql-${PROG}man;
  /usr/sbin/alternatives --install /usr/share/man/man1/${PROG}.1 pgsql-${PROG}man /etc/alternatives/pgsql-${PROG}man 920 --slave /etc/alternatives/pgsql-${PROG}man pgsql-${PROG}man /usr/pgsql-${VER}/share/man/man1/${PROG}.1;
done

# Start crond service
[root] /sbin/service crond start
[enstore] /sbin/service crond status