You could try this on your command line:
export PGDATA=/var/lib/postgresql/data
Then try the remove again. You might want to play around with different -f -m combinations to 'ignore' the error.
apt-get remove -f -m --purge postgresql-9.1
Or, you could, as root, just remove the files. First, make sure no postgres stuff is running (ps -ax | grep post). On my system I would:
rm -rf /var/lib/postgresql/data
rm -rf /usr/local/pgsql
(Careful with those rm -rf commands :-) )
The other thing that would need cleanup would be the startup and library stuff: Try:
ls /etc/*/postgr
if you see files like this:
/etc/init.d/postgresql /etc/rc2.d/S20postgresql
/etc/ld.so.conf.d/postgresql.conf /etc/rc3.d/S20postgresql
/etc/profile.d/postgres_path.sh /etc/rc4.d/S20postgresql
/etc/rc0.d/K20postgresql /etc/rc5.d/S20postgresql
/etc/rc1.d/K20postgresql /etc/rc6.d/K20postgresql
then the next step would be to just rm them:
rm -f /etc/*/*postgr*
The aptitude management of packages is pretty handy. I haven't ever used it to remove packages, I always worry if that will really work right. Good luck.