[postgis-users] problems while upgrading postgis

Sandro Santilli strk at kbt.io
Wed Nov 9 02:12:51 PST 2016


On Wed, Nov 09, 2016 at 09:45:59AM +0100, Paolo Importuni wrote:

> I am trying to migrate my postgres/postgis instance from 2.0 to 2.2.2
> The new  postgis.so library is in the right place and I found the right
> migration script postgis-2.0.0--2.2.2.sql.
> 
> I successfully upgraded three db instances by using the "ALTER EXTENSION
> postgis UPDATE TO '2.2.2';"  command, but it failed on one instance.
> 
> As far as I see, the problem might be that the postgis extension wasn't
> created using the "CREATE EXTENSION POSTGIS"  script, but maybe by some
> other methods.
> 
> If I try to create the extension, it fails saying "ERROR: type "spheroid"
> already exists"; if I try to upgrade it fails, saying that the extension
> postgis does not exist.
> 
> If I create a new db instance, create a new extension and then upgrade it
> to postgis 2.2. everything works fine.
> Is a there  a way to sort it out?

To turn your non-extension install to an extension one, try this:

  CREATE EXTENSION POSTGIS VERSION '2.0.0' FROM 'unpackaged';

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   https://strk.kbt.io/services.html


More information about the postgis-users mailing list