mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
Error while indexing #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sachin-Bhat on GitHub (Apr 19, 2024).
Hello,
I was getting the following error while indexing my embeddings onto PGVector. It did not throw such errors when I was using the old langchain-community implementation. Wondering if the database schema that created with the new implementation had some changes. Any clarification on how to go about this would be very helpful.
Cheers,
Sachin
@eyurtsev commented on GitHub (Apr 22, 2024):
I changed the schema due to issues with the community implementation.
Easiest solution is to re-create the schema if you don't mind re-indexing the data.
If you don't want to re-index the data, connect to the postgres instance and you'll need to write a bit of SQL to make the migration.
If I'm not mistaken the main change in the schema:
@Sachin-Bhat commented on GitHub (Apr 23, 2024):
Hey @eyurtsev,
Tried writing the necessary SQL to update the schema as specified by you. However, when I try to index documents, I get the following error:
Cheers,
Sachin
@eyurtsev commented on GitHub (Apr 23, 2024):
You need something like this to add a uniqueness constraint. This fixes a bug that is present in the community implementation and will make sure that you won't have duplicated content if you're indexing by id
Double check the commands / that it matches what you have in the database. Make a backup if you need before running it etc.
@Sachin-Bhat commented on GitHub (Apr 24, 2024):
Hey @eyurtsev,
I have tried to replicate the
langchain-communityindexed documents table schema to match that oflangchain-postgresas closely as possible. I do still get some errors:Any help here would be much appreciated.
Cheers,
Sachin