relation "langchain_pg_collection" does not exist #5

Closed
opened 2026-02-16 05:16:02 -05:00 by yindo · 1 comment
Owner

Originally created by @joshpopelka20 on GitHub (Apr 22, 2024).

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

Originally created by @joshpopelka20 on GitHub (Apr 22, 2024). 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
yindo closed this issue 2026-02-16 05:16:02 -05:00
Author
Owner

@joshpopelka20 commented on GitHub (Apr 23, 2024):

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()
@joshpopelka20 commented on GitHub (Apr 23, 2024): 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() ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#5