Updating PostGIS Databases

Posted by david
on 01 Nov 2010 at 10:56

I recently tried upgrading a PostGIS database to a newer version, going from 1.4.0 to 1.5.2. Unfortunately the upgrade scripts failed with the error

ERROR:  type "box3d_extent" is only a shell

The only thing that worked was to follow the advice given by Paul Ramsey, in his blog post PostGIS Back-up / Restore, and Steve Woodbridge, in a thread on the postgis-users list.

The only gotcha I see here is that pg_dump doesn’t include the database’s search path setting. So, I’ll have to remember to set the search path for the database when it’s restored. That doesn’t happen very often — usually only with major version upgrades of PostgreSQL — but it’s infrequent enough that it’s something that has the potential to get overlooked if it’s not documented.