Opened 3 years ago

Closed 3 years ago

#4185 closed defect (fixed)

Can't upgrade postgis raster

Reported by: robe Owned by: strk
Priority: blocker Milestone: PostGIS 3.0.0
Component: build/upgrade/install Version: master
Keywords: Cc:

Description

Getting this error on debbie when she tries to upgrade from 2.5.0rc3dev. Seems it's only raster upgrade, postgis upgrade is fine

Preparing db 'postgis_reg' using: CREATE EXTENSION postgis VERSION '2.5.0rc3dev'
Preparing db 'postgis_reg' using: CREATE EXTENSION postgis_raster VERSION '2.5.0rc3dev'
Died at run_test.pl line 1329.
 failed (Error encountered creating EXTENSION POSTGIS_RASTER: /var/lib/jenkins/workspace/postgis/tmp/3_0_pg9.6w64/regress_log)
-----------------------------------------------------------------------------
createlang: language "plpgsql" is already installed in database "postgis_reg"
CREATE EXTENSION
ERROR:  could not stat file "/var/lib/jenkins/workspace/pg/rel/pg9.6w64/share/postgresql/extension/postgis_raster--2.5.0rc3dev.sql": No such file or directory
ERROR:  could not stat file "/var/lib/jenkins/workspace/pg/rel/pg9.6w64/share/postgresql/extension/postgis_raster--2.5.0rc3dev.sql": No such file or directo

I assume the reason is raster is part of postgis in 2.5, so we'll definitely need to make accommodations for this in our test script.

Change History (3)

comment:1 Changed 3 years ago by strk

Is it run_test.pl trying to CREATE EXTENSION postgis_raster for 2.5.0 ? As it doesn't really make sense to even try ...

It should only happen IF the coming-from version has split raster, as per:

        if ( $OPT_WITH_RASTER && (
                # NOTE: this code is assuming that the default version
                # (!$OPT_UPGRADE_FROM) has split raster extension
                ! $OPT_UPGRADE_FROM ||
                has_split_raster_ext($OPT_UPGRADE_FROM)

The has_split_raster_ext perl subroutine is as follows:

sub has_split_raster_ext
{
  my $fullver = shift;
  my @ver = split(/\./, $fullver);
  return 0 if ( $ver[0] < 2 );
  return 0 if ( $ver[0] == 2 && $ver[1] < 5 );
  return 1;
}

Can you try running that routine in isolation with "2.5.0rc3dev" as input parameter ? It returns 0 here with perl v5.26.1

comment:2 Changed 3 years ago by strk

Sorry, I was mistaken, that subroutine is actually wrong as it thinks split-raster was introduced in 2.5.0 while instead we're adding it in 3.0.0. I'm going to push a fix.

comment:3 Changed 3 years ago by strk

Resolution: fixed
Status: newclosed

In 16829:

Tell run_test.pl that split-raster was introduced in PostGIS 3.0.0

Closes #4185

Note: See TracTickets for help on using tickets.