Hi Stephen! Thanks for today's IRC discussion, I'll try to summarize and create a mini-spec:
------ snip ------- 1. Add and ship /etc/postgresql/pg_upgradecluster.d/. Scripts in that directory will be called with the following arguments: <old version> <cluster name> <new version> <phase> <phase> is 'init' right after creating a virgin cluster of <newversion>, and 'finish' after all the data from the old version cluster has been dumped/reloaded into the new one. Packages like postgis and the admin can drop whichever scripts they like into this directory. 2. Change pg_upgradecluster to not restore objects which are already present in the new cluster. - after initializing the new cluster and calling pg_upgradecluster.d scripts with phase init, record already existing objects and databases: pg_dump -Fc --schema-only $db | pg_restore -l > /tmpdir/ignore-$db - determine set of objects that need to be restored from the old cluster: pg_dump -Fc --schema-only $db | pg_restore -l | sortmagic | > /tmpdir/restore-$db sortmagic is some perl code snippet which ignores all objects that occur in ignore-$db. - add -L /tmpdir/restore-$db argument to pg_restore call ------ snip ------- Things to discuss: - Does that per-cluster .d hook directory accomodate the needs of PostGIS? Would a per-database hook be better? - Is the ignore scheme sketched above enough, or do we need additional 'no dump' blacklists? Thanks for reviewing, Martin -- 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