You may get this error if some indexes were created before upgrading pgvecto.rs to 0.4.0:
ERROR: index public.this_is_index depends on operator class vector_cos_ops for access method vectors
index public.this_is_index depends on operator class vector_cos_ops for access method vectors cannot drop operator class vector_cos_ops for access method vectors because other objects depend on it
ERROR: cannot drop operator class vector_cos_ops for access method vectors because other objects depend on it
SQL state: 2BP01
Detail: index public.that_is_also_index depends on operator class vector_cos_ops for access method vectors
index public.that_is_also_index depends on operator class vector_cos_ops for access method vectors
Hint: Use DROP ... CASCADE to drop the dependent objects too.
You can simply drop these indexes, and then upgrade the extension:
DROPINDEXthis_is_index;DROPINDEXthat_is_also_index;ALTEREXTENSIONvectorsUPDATE;-- CREATE INDEX this_is_index ...
-- CREATE INDEX that_is_also_index ...
Upgrade from 0.1.x
You need to follow these steps to make ALTER EXTENSION vectors UPDATE work.
Let’s assume your pgvecto.rs version is 0.1.x (replace x with a number).