#! /bin/sh
#include <genscript.warning>

#include <prerm.inc>

if [ "$1" != failed-upgrade ]
then

	# Save the necessary binaries to pg_dumpall, in case an upgrade is
	# insufficient
	if ! save_bins
	then
		echo Could not save binaries for dumping current database
		exit 1
	fi
fi

if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/libpgsql2 ]; then
	rm -f /usr/doc/libpgsql2
fi

