Hi, long time no see with this bug. I was waiting for PostgreSQL upstream to accept my pg_restore patch [1] which is a necessary prerequisite for solving this. I temporarily landed on the 'patches to apply' queue but then disappeared again without notice. So I recently proposed it again [2] without any answer so far, but I committed this now into the postgresql-8.1 package tree, so that we'll have it available in Debian soon.
With the new -X no-data-for-failed-tables option of pg_restore, the specification becomes much easier. Also, during the discussion there were some updates, so I summarize it again: ------ snip ------- 1. Add and ship /etc/postgresql-common/upgrade.d/. Scripts in that directory will be called with the following arguments: <old version> <cluster name> <new version> <db user to connect as> <phase> Phases: init: a virgin cluster of version <newversion> has been created, i. e. this new cluster will already have template1, but no user databases finish: all data from the old version cluster has been dumped/reloaded into the new one. The old cluster still exists, and only the superuser is allowed to connect to either cluster. Packages like postgis and the admin can drop whichever scripts they like into this directory. 2. Change pg_upgradecluster to use pg_restore -X no-data-for-failed-tables. pg_upgradecluster will complain if there are upgrade scripts and the installed pg_restore version does not yet support this option. The effect of this option is that already existing tables in the new cluster will not be touched. 3. A table blacklist might be convenient in the future, but is not immediately necessary, so it will not be implemented at this point. ------ snip ------- Comments appreciated, Martin [1] http://archives.postgresql.org/pgsql-hackers/2006-02/msg00694.php [2] http://archives.postgresql.org/pgsql-hackers/2006-07/msg00669.php -- Martin Pitt http://www.piware.de Ubuntu Developer http://www.ubuntu.com Debian Developer http://www.debian.org In a world without walls and fences, who needs Windows and Gates?
signature.asc
Description: Digital signature