[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Purging database packages



I'm raising this issue in relation to PostgreSQL, but I am also copying to
the maintainers of msql and mysql, for whom the same issues must be relevant.


When a database package is purged, the implication is that the data stored
in the database should also be deleted.  Therefore I have added the
instructions to delete the data to postgresql's postrm.

However, since it is possible to flag whole groups of packages for purging
when using dselect, I feel I ought to protect users against inadvertently
destroying their data - the package can easily be reinstalled, but no-one
else can recreate the data.

Therefore I have made the postrm script interactive:

  if [ "$1" = purge -a -d /var/postgres/data ]
  then
	echo Request to purge PostgreSQL implies removal of database files
	echo at /var/postgres/data, which contain the actual database data.
	echo
	echo "OK to remove these files and destroy the data? (y/n): "
	read answer
	case answer in
		y|Y|YES|yes|Yes)
			rm -rf postgres/data
			;;
	esac
  fi
  rm /var/postgres/.{profile,login}
  rmdir /var/postgres ||
	echo /var/postgres not empty so not removed.


Now, section 2.3.8 of the Policy Manual states that we should minimise 
interactive prompting while installing; it does not even contemplate the
idea of prompting in the removal scripts.

So I have these policy questions:

1. Is it OK to put interactive prompting in the removal scripts?

2. To what extent should we try to protect users from the consequences of
   their own (possibly inadvertent) actions?

3. Should there be policy on this matter for database packages in particular?

The reason for particularly mentioning databases, is that they can contain
huge amounts of valuable data.  Accidentally destroying this data could
be disastrous.


To reduce congestion on debian-devel, I suggest that follow-up on this be
restricted to debian-policy.  

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Search me, O God, and know my heart; try me, and know 
      my thoughts. And see if there be any wicked way in me,
      and lead me in the way everlasting."        
                  Psalms 139:23,24 



--
To UNSUBSCRIBE, email to debian-policy-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: