delete_collection() Does Not Remove Records from upsertion_record Table #52

Open
opened 2026-02-16 05:16:19 -05:00 by yindo · 0 comments
Owner

Originally created by @ElderBarbosaLima on GitHub (Oct 23, 2024).

Problem Description:
When attempting to delete a collection using the delete_collection() method, the records in the upsertion_record table are not deleted. This causes an issue when trying to re-populate the collection with the same name. Upon embedding the new content, LangChain skips these records because they still exist in the upsertion_record table.

Steps to Reproduce:
Create a collection and embed content.
Use the delete_collection() method to delete the collection.
Recreate a collection with the same name and try embedding new content.
Observe that LangChain skips embedding records due to existing entries in upsertion_record.
Expected Behavior:
The delete_collection() method should remove all associated records, including entries in the upsertion_record table, allowing new content to be embedded without being skipped.

Actual Behavior:
The collection is deleted, but records in the upsertion_record table remain, preventing new content from being embedded.

Environment:
libs versions: langchain==0.3.1 langchain-openai==0.2.1 langchain-community==0.3.1 langchain-text-splitters==0.3.0 pgvector==0.2.5 tiktoken==0.7.0 certifi==2023.11.17 semchunk==2.2.0 openpyxl==3.1.5 PyPDF2==3.0.1 transformers==4.43.3 PyMuPDF==1.24.10 uvicorn==0.31.0 fastapi==0.115.0 executing==2.1.0 pyyaml==6.0.2 boto3==1.35.36 langchain_postgres==0.0.12 psycopg2-binary==2.9.9 psycopg-binary==3.2.3 psycopg-pool==3.2.3 bs4==0.0.2

Database: Postgres with an extension vector
Possible Solution:
Ensure that the delete_collection() method properly deletes all records from both the collection and associated metadata tables such as upsertion_record.

Originally created by @ElderBarbosaLima on GitHub (Oct 23, 2024). **Problem Description:** When attempting to delete a collection using the delete_collection() method, the records in the upsertion_record table are not deleted. This causes an issue when trying to re-populate the collection with the same name. Upon embedding the new content, LangChain skips these records because they still exist in the upsertion_record table. **Steps to Reproduce:** Create a collection and embed content. Use the delete_collection() method to delete the collection. Recreate a collection with the same name and try embedding new content. Observe that LangChain skips embedding records due to existing entries in upsertion_record. Expected Behavior: The delete_collection() method should remove all associated records, including entries in the upsertion_record table, allowing new content to be embedded without being skipped. **Actual Behavior:** The collection is deleted, but records in the upsertion_record table remain, preventing new content from being embedded. Environment: libs versions: langchain==0.3.1 langchain-openai==0.2.1 langchain-community==0.3.1 langchain-text-splitters==0.3.0 pgvector==0.2.5 tiktoken==0.7.0 certifi==2023.11.17 semchunk==2.2.0 openpyxl==3.1.5 PyPDF2==3.0.1 transformers==4.43.3 PyMuPDF==1.24.10 uvicorn==0.31.0 fastapi==0.115.0 executing==2.1.0 pyyaml==6.0.2 boto3==1.35.36 langchain_postgres==0.0.12 psycopg2-binary==2.9.9 psycopg-binary==3.2.3 psycopg-pool==3.2.3 bs4==0.0.2 Database: Postgres with an extension vector Possible Solution: Ensure that the delete_collection() method properly deletes all records from both the collection and associated metadata tables such as upsertion_record.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#52