Opened 4 years ago

Closed 4 years ago

#4668 closed defect (worksforme)

Error upgrading from postgis 2.5.1 to PostGIS 3.0.1

Reported by: robe Owned by: strk
Priority: medium Milestone: PostGIS 2.5.5
Component: build Version: 2.5.x -- EOL
Keywords: Cc:

Description

Get this error on my oldest PostGIS windows install.

When running

SELECT postgis_extensions_upgrade();  -- second call
ALTER EXTENSION postgis_raster ADD OPERATOR CLASS hash_raster_ops USING hash;
operator class hash_raster_ops does not exist for access method hash


Change History (3)

comment:1 by robe, 4 years ago

Had to manually install this section of rtpostgis.sql script

-------------------------------------------------------------------
-- HASH operators
-------------------------------------------------------------------

-- call PostgreSQL's hashvarlena() function
-- Availability: 2.1.0
CREATE OR REPLACE FUNCTION raster_hash(raster)
	RETURNS integer
	AS 'hashvarlena'
	LANGUAGE 'internal' IMMUTABLE STRICT PARALLEL SAFE;

-- use raster_hash() to compare
-- Availability: 2.1.0
CREATE OR REPLACE FUNCTION raster_eq(raster, raster)
	RETURNS bool
	AS $$ SELECT raster_hash($1) = raster_hash($2) $$
	LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE;

-- Availability: 2.1.0
CREATE OPERATOR = (
	LEFTARG = raster, RIGHTARG = raster, PROCEDURE = raster_eq,
	COMMUTATOR = '=',
	RESTRICT = eqsel, JOIN = eqjoinsel
);

-- Availability: 2.1.0
CREATE OPERATOR CLASS hash_raster_ops
	DEFAULT FOR TYPE raster USING hash AS
	OPERATOR	1	= ,
	FUNCTION	1	raster_hash (raster);

before could run upgrade again

comment:2 by strk, 4 years ago

It looks like those operators are advertised as being available since 2.1.0, why didn't you have them in your 2.5.x source ? Is that a PostgreSQL-version specific availability ?

comment:3 by robe, 4 years ago

Resolution: worksforme
Status: newclosed

Just tried again upgrading from 2.5.5dev to 3.0.1 and seemd to work fine. Not sure what caused this.

Note: See TracTickets for help on using tickets.