Opened 5 years ago

Closed 4 years ago

#4555 closed defect (duplicate)

Can't repackage postgis_raster with postgis_extensions_upgrade when postgis not installed in public

Reported by: robe Owned by: strk
Priority: blocker Milestone: PostGIS 3.0.1
Component: build Version: 3.0.x
Keywords: Cc:

Description

CREATE SCHEMA postgis;
ALTER DATABASE test SET search_path=public, contrib, postgis, tiger, utility;

— reconnect

CREATE EXTENSION postgis SCHEMA postgis VERSION "2.5.3";

-- disconnect

— reconnect

SELECT postgis_full_version(); --is at 2.5.3

SELECT postgis_extensions_upgrade();

— outputs

POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="110" GEOS="3.8.0-CAPI-1.13.1 " PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.4.2, released 2019/06/28" LIBXML="2.9.9" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.4.3 (Internal)" RASTER (raster lib from "2.5.3 r17699" need upgrade) [UNPACKAGED!] (raster procs from "2.5.3 r17699" need upgrade)

Repeat again

SELECT postgis_extensions_upgrade();

Gives error:

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

To force repackaging I had to do this:

CREATE EXTENSION postgis_raster FROM unpackaged VERSION "3.0.0" SCHEMA postgis;

I thought I had tested this already, but I've always been doing

ALTER EXTENSION postgis UPDATE;

So perhaps this only happens if you don't do ALTER EXTENSION postgis UPDATE because the 2.5.3 is incomplet.

Change History (1)

comment:1 by robe, 4 years ago

Resolution: duplicate
Status: newclosed

Looks like this is a duplicate of #4581 so closing this one out

Note: See TracTickets for help on using tickets.