[postgis-tickets] [PostGIS] #4581: installing postgis_raster from unpackaged tries to use wrong schema

PostGIS trac at osgeo.org
Sat Nov 16 08:30:31 PST 2019


#4581: installing postgis_raster from unpackaged tries to use wrong schema
-----------------------------------+---------------------------
 Reporter:  robe                   |      Owner:  strk
     Type:  defect                 |     Status:  new
 Priority:  critical               |  Milestone:  PostGIS 3.0.1
Component:  build/upgrade/install  |    Version:  2.5.x
 Keywords:                         |
-----------------------------------+---------------------------
 I'm not sure if this is because I wasn't using the latest PostGIS 2.5.

 I tried to upgrade a database that has installed PostGIS 2.5.1 (in postgis
 schema) to PostGIS 3.0.0.

 Using these commands:


 {{{
 SELECT postgis_extensions_upgrade();
 }}}

 As expected it was successful, but told me that raster is now unbundled so
 needs to be rebundled, and to run


 {{{
 SELECT postgis_extensions_upgrade();
 }}}

 On the bundling run, I got this notice

 {{{
 NOTICE:  Extension postgis_sfcgal is not available or not packagable for
 some reason
 NOTICE:  Packaging extension postgis_raster
 WARNING:  'postgis.gdal_datapath' is already set and cannot be changed
 until you reconnect
 WARNING:  'postgis.gdal_enabled_drivers' is already set and cannot be
 changed until you reconnect
 WARNING:  'postgis.enable_outdb_rasters' is already set and cannot be
 changed until you reconnect

 ERROR:  function tiger.st_srid(geometry) does not exist
 LINE 1: ..._makeemptyraster($1, $2, $3, $4, $5, -($5), 0, 0, tiger.ST_S...
                                                              ^
 HINT:  No function matches the given name and argument types. You might
 need to add explicit type casts.
 QUERY:   SELECT  tiger.ST_makeemptyraster($1, $2, $3, $4, $5, -($5), 0, 0,
 tiger.ST_SRID('POINT(0 0)'::geometry))
 CONTEXT:  SQL statement "CREATE EXTENSION postgis_raster FROM unpackaged"
 PL/pgSQL function postgis_extensions_upgrade() line 48 at EXECUTE
 SQL state: 42883
 }}}


 I think tiger might change path during upgrade, so guessing that's why it
 picked that up.  So I thought I'll just start a new connection and run the
 upgrade process again.

 And what happened is it tried to install in default location:


 {{{
 NOTICE:  Extension postgis_sfcgal is not available or not packagable for
 some reason
 NOTICE:  Packaging extension postgis_raster
 WARNING:  'postgis.gdal_datapath' is already set and cannot be changed
 until you reconnect
 WARNING:  'postgis.gdal_enabled_drivers' is already set and cannot be
 changed until you reconnect
 WARNING:  'postgis.enable_outdb_rasters' is already set and cannot be
 changed until you reconnect

 ERROR:  function public.st_srid(geometry) does not exist
 LINE 1: ..._makeemptyraster($1, $2, $3, $4, $5, -($5), 0, 0, public.ST_...
                                                              ^
 HINT:  No function matches the given name and argument types. You might
 need to add explicit type casts.
 QUERY:   SELECT  public.ST_makeemptyraster($1, $2, $3, $4, $5, -($5), 0,
 0, public.ST_SRID('POINT(0 0)'::geometry))
 CONTEXT:  SQL statement "CREATE EXTENSION postgis_raster FROM unpackaged"
 PL/pgSQL function postgis_extensions_upgrade() line 48 at EXECUTE
 SQL state: 42883
 }}}


 So it seems our postgis_extensions_upgrade, instead of trying to install
 in current default path, should do something like:


 {{{
 CREATE EXTENSION postgis_raster FROM unpackaged SCHEMA <path-that-postgis-
 is-installed-in>
 }}}

 Indeed I got around the issue by doing this:

 {{{
 CREATE EXTENSION postgis_raster FROM unpackaged SCHEMA postgis;
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4581>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list