[postgis-devel] New uninstall_postgis.sql script

Tom Lane tgl at sss.pgh.pa.us
Sat Jun 6 10:30:40 PDT 2009


"Obe, Regina" <robe.dnd at cityofboston.gov> writes:
> At the moment, the script simply uses DROP TYPE ... CASCADE on the 
> PostGIS types which removes them completely from the database; however 
> it struck me that this could be a way of unifying our 
> installation/removal/upgrade procedures since an upgrade process 
> involves removing all of the old definitions and adding the new ones. 
> Obviously this would only work with 1.4 onwards, but easier upgrades 
> would put us in a great position going forwards. Thoughts?

You might want to have a look at the recent discussions about
pg_migrator on the pgsql-hackers list.  We are currently wondering
about how to do upgrade-in-place in the presence of add-on modules,
and it looks like a mess if the add-on modules' SQL-level definition
has changed at all.  In particular, DROP TYPE ... CASCADE is really
a complete nonstarter for upgrades, because it will happily remove
all the user's data columns of that type!

My own thoughts are running to the idea that the add-on module would
need to provide a version update script that drops and re-adds only
the SQL definitions that actually changed.  Obviously this is a PITA
from a maintenance standpoint, but I'm not seeing any other workable
answer.

If you missed the upgrade discussion at PGCon, it's worth looking
at the slides and/or video:
http://www.pgcon.org/2009/schedule/events/189.en.html

			regards, tom lane



More information about the postgis-devel mailing list