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

Regina Obe lr at pcorp.us
Wed Oct 13 06:18:33 PDT 2021


> 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
> The "procs need upgrade" warning was not present in v13 before the
upgrade.
It always shows that after pg_upgrade, because you have upgraded to a new
version of PostgreSQL that might need the new features enabled.

> Am I supposed to have run postgis_extensions_upgrade() after installing a
> patchlevel update to postgis, and before running pg_upgrade ?
> 
[Regina Obe] 
1) Yes you should always run postgis_extensions_upgrade() after any patch
level update to postgis
2) You should also run it after pg_upgrade because some features are
disabled for lower versions of PostgreSQL.
e.g. brin was disabled for PostgreSQL < 9.5 so if you missed running the
upgrade, you would have no brin even in newer PostgreSQL versions which
might be the cause of this.

But still though I thought we had a lot of these brin issues and added logic
to catch these faulty installs in later micros.



> 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
[Regina Obe] 
You shouldn't need to comment out the operator class.  The error suggests 
" 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"

its failing cause you have no operator class brin.
So it's failing because it's trying to add the non-existent operator class
to the postgis extension.



More information about the postgis-devel mailing list