chown -R postgres /var/lib/postgresql/*
rm -f /etc/postgresql/9.4/main/postgresql.conf.bak
pg_dropcluster --stop 9.4 main
DEBIAN_FRONTEND=noninteractive apt-get purge -y \
       postgresql-9.4 \
       postgresql-contrib-9.4 \
       postgresql-plpython-9.4 \
       postgresql-client-9.4 \
       postgresql-common
rm -rf /run/postgresql/9.4-main.pg_stat_tmp
rm -rf  /var/lib/postgresql/data \
        /var/lib/postgresql/analyze_new_cluster.sh \
        /var/lib/postgresql/delete_old_cluster.sh
reboot
