pgvector - hnsw index table drop is not using schema name #1275
Labels
bug
Something isn't working
contributions wanted!
Looking for external contributions
integration:pgvector
Describe the bug
If using pgvector, hnsw and multiple schema names (not the default one) the "hnsw index drop" does not drop the table, even if
hnsw_recreate_index_if_exists=True.
It seems to me that there is missing schema_name before table_name in drop index SQL query in:
pgvector/document_store.py (row 392)
Current code:
sql_drop_index = SQL("DROP INDEX IF EXISTS {index_name}").format(index_name=Identifier(self.hnsw_index_name))
Should be:
sql_drop_index = SQL("DROP INDEX IF EXISTS {schema_name}.{index_name}").format(schema_name=Identifier(self.schema_name),index_name=Identifier(self.hnsw_index_name))
To Reproduce
Minimal example code: https://gist.github.com/mabartcz/4faa3e1ae7a56c8a9536b1ab8e7d4572
Describe your environment (please complete the following information):
If I am not missing something, I can create PR to fix the issue :)
The text was updated successfully, but these errors were encountered: