relation "langchain_pg_collection" does not exist
joshpopelka20 opened this issue · comments
joshpopelka20 commented
After creating the vector store,
vectorstore = PGVector(
embeddings=embeddings,
collection_name=collection_name,
connection=connection,
use_jsonb=True
)
I try to run:
vectorstore.add_documents(docs, ids=[doc.metadata['id'] for doc in docs])
I'm getting this error message: relation "langchain_pg_collection" does not exist
I'm using python3.10, psycopg3, and langchain-postgres v0.0.3
joshpopelka20 commented
For anyone else facing this issue, I was able to figure it out by running these two commands after vectorstore.drop_tables():
vectorstore.create_tables_if_not_exists()
vectorstore.create_collection()