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

Regina Obe lr at pcorp.us
Sun Oct 24 23:50:15 PDT 2021


> On Wed, Oct 13, 2021 at 09:18:33AM -0400, Regina Obe wrote:
> > 1) Yes you should always run postgis_extensions_upgrade() after any
> > patch level update to postgis
> 
> I've now added this to my upgrade scripts.
> 
> I should also add that up to now I've been upgrading postgis by running
> postgis_upgrade.sql.  I'm sure I should have switched to using extensions,
but
> I missed that last year before upgrading everying to pg13, which no longer
> supports "FROM UNPACKAGED".  So eventually I have to clean it up.
> 
> It looks like postgis_extensions_upgrade() handles that for postgis, which
is
> great.  Thanks for that.
> 
> > 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.
> 
> This is a bit beyond the limits of my understanding.
> 
> The server which has this error has:
> 
>  brin   | brin_geography_inclusion_ops   | &&(gidx,gidx)
> |        3 | search
>  brin   | brin_geography_inclusion_ops   | &&(geography,gidx)
> |        3 | search
>  brin   | brin_geography_inclusion_ops   | &&(gidx,geography)
> |        3 | search
> 
> Thanks,
> --
> Justin
[Regina Obe] 
Okay I found the ticket where I ran into the same issue.
Looks like it was closed cause it was deemed only an issue for 9.3

https://trac.osgeo.org/postgis/ticket/3633

Although from your above, it looks like you already have this operator
class, but I'm not sure what command you used to generate that search
result.

What happens if you try to do this in that database:

ALTER EXTENSION postgis ADD OPERATOR CLASS brin_geography_inclusion_ops
USING brin;

If it is not present you will get the above error you pointed at.

If it is there but just not bound to the postgis extension, then it should
succeed.

If it is there and already included as part of the postgis extension, then
you should get error:

ERROR:  operator class brin_geography_inclusion_ops for access method brin
is already a member of extension "postgis"

Hope that helps,
Regina



More information about the postgis-devel mailing list