Postgresql-8.4 is the packaged version for Ubuntu 10.04 (aka lucid) but earlier today I purged and reinstalled it and found a packaging bug -- sudo aptitude purge postgresql does not cleanly remove the conf files from the filesystem if they had been edited. All the older edits I had made to /etc/postgresql/8.4/main/pg_hba.conf and /etc/postgresql/8.4/main/pg_ident.conf files were intact after the reinstallation. So the new re-installation would throw weird errors.

Ideally aptitude/apt-get 'purge' is the cleanest way to uninstall software but if you have customized the configuration settings in a DB you would not like to lose those changes (especially because you may have installed the database a long time ago and may not remember each change for different apps that use the DB.

Sounds good but in theory a 'purge' littering your filesystem with edited files makes it hard for folks to hunt out which file was leftover and whether re-editing "foo.conf" would get "foo-application" running smoothly.  For smaller single packages its probably easy to script a list of files from the original package and check the filesystem against that list but what if you had an installation that had 80+ odd installation steps for multiple packages that depend on each other ...that is a lot of retracing -- the installation and purging of 80+ installation steps is scriptable but a clean reinstallation of your OS is far less time-consuming, not to mention the resource savings.