[postgis-devel] ERROR: operator class "brin_geography_inclusion_ops" does not exist for access method "brin"

Justin Pryzby pryzby at telsasoft.com
Sun Oct 10 12:47:43 PDT 2021


I pg_upgraded another instance and hit this error again.

ts=# SELECT postgis_full_version();
postgis_full_version | POSTGIS="3.1.4 ded6c34" PGSQL="130" (procs need upgrade for use with PostgreSQL "140") GEOS="3.9.1-CAPI-1.14.2" PROJ="7.2.1" LIBXML="2.9.1" LIBJSON="0.11"

ts=# SELECT postgis_extensions_upgrade();
NOTICE:  Packaging extension postgis
ERROR:  operator class "brin_geography_inclusion_ops" does not exist for access method "brin"
CONTEXT:  SQL statement "ALTER EXTENSION postgis ADD OPERATOR CLASS brin_geography_inclusion_ops USING brin"
PL/pgSQL function inline_code_block line 3 at SQL statement
SQL statement "CREATE EXTENSION postgis SCHEMA public VERSION unpackaged;ALTER EXTENSION postgis UPDATE TO "3.1.4""
PL/pgSQL function postgis_extensions_upgrade() line 68 at EXECUTE

The "procs need upgrade" warning was not present in v13 before the upgrade.

[pryzbyj at database ~]$ sudo grep gis /var/log/yum.log
Apr 09 16:51:44 Updated: postgis31_13-3.1.1-3.rhel7.x86_64
Apr 09 16:51:44 Updated: postgis31_13-client-3.1.1-3.rhel7.x86_64
Oct 10 14:57:59 Updated: postgis31_13-3.1.4-1.rhel7.x86_64
Oct 10 14:57:59 Updated: postgis31_13-client-3.1.4-1.rhel7.x86_64
Oct 10 14:58:38 Installed: postgis31_14-3.1.4-1.rhel7.x86_64
Oct 10 14:58:38 Installed: postgis31_14-client-3.1.4-1.rhel7.x86_64

Am I supposed to have run postgis_extensions_upgrade() after installing a
patchlevel update to postgis, and before running pg_upgrade ?

Since there's nothing to enforce that, what am I supposed to do now ?

If I comment enough parts out, this works:

ts=# begin;    CREATE OPERATOR CLASS brin_geography_inclusion_ops
  DEFAULT FOR TYPE geography
  USING brin AS
    FUNCTION      1        brin_inclusion_opcinfo(internal),
    FUNCTION      2        geog_brin_inclusion_add_value(internal, internal, internal, internal),
    FUNCTION      3        brin_inclusion_consistent(internal, internal, internal),
    FUNCTION      4        brin_inclusion_union(internal, internal, internal),
    OPERATOR      3        &&(geography, geography),
    -- OPERATOR      3        &&(geography, gidx),
    -- OPERATOR      3        &&(gidx, geography),
    -- OPERATOR      3        &&(gidx, gidx),
  STORAGE gidx;

BEGIN
CREATE OPERATOR CLASS

-- 
Justin 


More information about the postgis-devel mailing list