Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#3919 closed defect (fixed)

Broken upgrade: ERROR: function geometry_hash(geometry) does not exist

Reported by: strk Owned by: pramsey
Priority: blocker Milestone: PostGIS 2.5.0
Component: postgis Version: master
Keywords: Cc:

Description

From our good Dronie bot: https://drone.osgeo.org/postgis/postgis/632

Preparing db 'postgis_reg' using: CREATE EXTENSION postgis VERSION '2.1.2'
Upgrading PostGIS in 'postgis_reg' using: ALTER EXTENSION postgis UPDATE TO '2.5.0dev'
Died at run_test.pl line 1423.
 failed (Error encountered altering EXTENSION POSTGIS: /tmp/pgis_reg/regress_log)
-----------------------------------------------------------------------------
createlang: language "plpgsql" is already installed in database "postgis_reg"
CREATE EXTENSION
ERROR:  function geometry_hash(geometry) does not exist
CONTEXT:  SQL statement "
    CREATE OPERATOR CLASS hash_geometry_ops
	DEFAULT FOR TYPE geometry USING hash AS
    OPERATOR    1   = ,
    FUNCTION    1   geometry_hash(geometry);
    "
PL/pgSQL function inline_code_block line 4 at EXECUTE statement
-----------------------------------------------------------------------------

r16058 was the first failing commit.

Change History (9)

comment:1 Changed 2 years ago by strk

If I'm not mistaken our upgrade script generator understands "Availability" comments inside operator class elements, see how it is done with gist_geometry_ops_nd for an example.

comment:2 Changed 2 years ago by strk

In 16064:

Set availability of new geometry_hash OPERATOR CLASS function

See #3919

comment:3 Changed 2 years ago by strk

In 16065:

Revert "Set availability of new geometry_hash OPERATOR CLASS function"

This reverts r16064 aka commit 18590c2f03629e0f0ed21193376bd32e5c919867.

It was a silly attempt, as the whole operator class availability is new !

References #3919

comment:4 Changed 2 years ago by strk

Sorry, the Availability thing was silly as the whole opclass is new. This may be more into the upgrade creation script to fix.

comment:5 Changed 2 years ago by strk

Resolution: fixed
Status: assignedclosed

In 16066:

Don't forget "OR REPLACE" in "CREATE FUNCTION!"

Fixes #3919

comment:6 Changed 2 years ago by strk

Found: it was a missing "OR REPLACE" in the "CREATE FUNCTION", which confused the upgrade script regexp... Should be fixed by r16066

comment:7 Changed 2 years ago by strk

comment:8 Changed 2 years ago by strk

In 16078:

Stricter error tolerance on unpackaged upgrade

Prevents concerns about "object_not_in_prerequisite_state" being
possibly thrown for errors other than "already in extension"

See #3919

NOTE: this check may be to strict in that it depends on locale

settings

comment:9 Changed 2 years ago by strk

Sorry the above changeset r16078 was aimed at fixing #3913, not this ticket

Note: See TracTickets for help on using tickets.