migrate_pgvector_collection#

langchain_postgres.utils.pgvector_migrator.migrate_pgvector_collection(
engine: PGEngine,
collection_name: str,
vector_store: PGVectorStore,
delete_pg_collection: bool | None = False,
insert_batch_size: int = 1000,
) None[source]#

Migrate all data present in a PGVector collection to use separate tables for each collection. The new data format is compatible with the PGVectorStore interface.

Parameters:
  • engine (PGEngine) – The PG engine corresponding to the Database.

  • collection_name (str) – The collection to migrate.

  • vector_store (PGVectorStore) – The PGVectorStore object corresponding to the new collection table.

  • delete_pg_collection (bool) – An option to delete the original data upon migration. Default: False. Optional.

  • insert_batch_size (int) – Number of rows to insert at once in the table. Default: 1000.

Return type:

None