Package: postgresql Version: 9.6+181+deb9u2 I am creating this bugreport because of a mishap that now has happened twice to me and I think it does not actually have to happen and maybe the behavior of the package should be changed.
1) At home I once tried a document management system for my private home paper work. It worked great until I did a debian upgrade of the server. Everything worked fine and I also --purge all removed packages. Then all of sudden the database was gone. After noticing that I should not have --purge the old version of postgresql I found out that I had no backups. Since then I work with paper again. Of course it is my fault, but ... 2) Yesterday at work I did a massive upgrade of all kinds of virtual machines at the same time. A lot of different services like mail, fileserver, etc. So again I ran into the pitfall that purging old packages deletes my postgresql cluster. Of course I have backups but the work of one day is lost and all employees are very happy of course. Yes I know it is my fault, but ... Here are the arguments I have against cleaning up the actual cluster files when --purge postgresql a) Compare postgresql to samba or nfs-kernel-server. When purging these packages, the files on the filesystem which the server was serving will certainly not be removed. But on postgresql they are. b) What is worse? Having files not owned by a corresponding package in /var/lib/postgresql or losing a complete database on system upgrade? c) Compare this to for example ruby gems. When doing gem install xxx as root, you will get files in /var/lib/gems/version/... Now when upgrading the system you will get a new ruby version and when installing gems, a new version directory will be built. The old one just stays there and nobody ever deletes it. Especially not the old ruby packages when you --purge them. I am sure I am not the only one who fell in this --purge trap. To say it again, of course it is my own fault, but still I think that the package should not delete the cluster on --purge. Please rethink that decision. Thanks Erik