Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pgvector store error #1329

Open
rhajou opened this issue Jan 29, 2025 · 1 comment
Open

Pgvector store error #1329

rhajou opened this issue Jan 29, 2025 · 1 comment
Labels
bug Something isn't working integration:pgvector P3

Comments

@rhajou
Copy link
Contributor

rhajou commented Jan 29, 2025

Describe the bug
I am trying to insert to Alloydb using PgVectorDocumentStore but sometimes multiple runs of the same insertion script are running at the same time (insertion of multiple documents in more than 100 different scripts)

I am seeing the following error:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/haystack_integrations/document_stores/pgvector/document_store.py", line 303, in _execute_sql result = cursor.execute(sql_query, params) File "/usr/local/lib/python3.10/site-packages/psycopg/cursor.py", line 97, in execute raise ex.with_traceback(None) psycopg.errors.UniqueViolation: duplicate key value violates unique constraint "pg_class_relname_nsp_index"
as I saw online this solution (https://stackoverflow.com/questions/74261789/postgres-create-table-if-not-exists-%E2%87%92-23505)

But how should we implement this behavior in Haystack?

Noting that my parameters:

schema_name: public
table_name: mytablealloydb
embedding_dimension: 768 
vector_function: cosine_similarity
recreate_table: False
search_strategy: hnsw
hnsw_recreate_index_if_exists: False
keyword_index_name: "mytablealloydb_keyword_index"

To Reproduce
Run same script 200 times in parallel and you can reproduce it

  • OS: debian
  • Haystack version: 2.8.1
  • Integration version: 0.8.0
@rhajou rhajou added the bug Something isn't working label Jan 29, 2025
@anakin87
Copy link
Member

Hello!

At first glance, I can't say whether on our end, we can do anything to solve your problem.

In any case, it might be helpful to have a code example of the document insertion script you're using...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration:pgvector P3
Projects
None yet
Development

No branches or pull requests

3 participants