pg_version=`pg_lsclusters | grep 5432 | grep online | cut -d' ' -f1`
if [ "x$pg_version" != "x" ]
then
- export pg_hba_dir=/etc/postgresql/${pg_version}/main/
+ export pg_hba_dir=/etc/postgresql/${pg_version}/main
else
- echo "No database found online on port 5432"
- echo "Couldn't initialize or upgrade @OLDPACKAGE@ database."
- echo "Please see postgresql documentation"
- echo "and run dpkg-reconfigure -plow @OLDPACKAGE@-db-postgresql"
- echo "once the problem is solved"
- echo "exiting without error, but @OLDPACKAGE@ db will not work"
- echo "right now"
+ echo "No database found online on port 5432."
+ echo "Assuming the database was dropped and no action is needed."
+ echo "Exiting without error, but make sure there are no leftovers."
exit 0
fi
else
/usr/share/@OLDPACKAGE@/bin/install-db.sh purge-files
ucf --debconf-ok ${pg_hba_dir}/pg_hba.conf.@OLDPACKAGE@-new ${pg_hba_dir}/pg_hba.conf
rm ${pg_hba_dir}/pg_hba.conf.@OLDPACKAGE@-new
- ucf --purge ${pg_hba_dir}/pg_hba.conf
pg_name=postgresql-$pg_version
# Trying "postgresql" init script...
+ v=0
invoke-rc.d postgresql reload || v=$?
if test x"$v" = x"100"; then
# No "postgresql" init script (for packages << 8.4.4-2)