From 7c7cac1cfd0dfbe35ebd5cf07e868f58d0f867f1 Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 13 Feb 2025 00:39:40 +0800 Subject: [PATCH] fix: remove unnecessary param binding, use direct workspace string interpolation --- lightrag/kg/postgres_impl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index eaa1dd92..08d559fb 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -425,9 +425,9 @@ class PGDocStatusStorage(DocStatusStorage): """Return keys that don't exist in storage""" keys = ",".join([f"'{_id}'" for _id in data]) sql = ( - f"SELECT id FROM LIGHTRAG_DOC_STATUS WHERE workspace=$1 AND id IN ({keys})" + f"SELECT id FROM LIGHTRAG_DOC_STATUS WHERE workspace='{self.db.workspace}' AND id IN ({keys})" ) - result = await self.db.query(sql, {"workspace": self.db.workspace}, True) + result = await self.db.query(sql, multirows=True) # The result is like [{'id': 'id1'}, {'id': 'id2'}, ...]. if result is None: return set(data)