From 188a7bd65335c6f6120601672886359616318e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E7=8C=AB?= Date: Tue, 2 May 2023 11:57:31 +0800 Subject: [PATCH] fix: pgvector hang risk if table not exist #3883 (#3884) --- langchain/vectorstores/pgvector.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/langchain/vectorstores/pgvector.py b/langchain/vectorstores/pgvector.py index 27008eb5..d0101771 100644 --- a/langchain/vectorstores/pgvector.py +++ b/langchain/vectorstores/pgvector.py @@ -165,9 +165,11 @@ class PGVector(VectorStore): def create_tables_if_not_exists(self) -> None: Base.metadata.create_all(self._conn) + self._conn.commit() def drop_tables(self) -> None: Base.metadata.drop_all(self._conn) + self._conn.commit() def create_collection(self) -> None: if self.pre_delete_collection: