From 495f755a1cbde8d8ca6d5a07133add7e774ff52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=8A=B1?= Date: Tue, 15 Apr 2025 14:57:17 +0800 Subject: [PATCH] fix: PostgreSQL database, error:subquery in FROM must have an alias --- lightrag/kg/postgres_impl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index c067a0d0..346e0496 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -1819,10 +1819,10 @@ SQL_TEMPLATES = { FROM LIGHTRAG_VDB_ENTITY e JOIN relevant_chunks c ON c.chunk_id = ANY(e.chunk_ids) WHERE e.workspace=$1 - ) - WHERE distance>$2 - ORDER BY distance DESC - LIMIT $3 + ) as chunk_distances + WHERE distance>$2 + ORDER BY distance DESC + LIMIT $3 """, "chunks": """ WITH relevant_chunks AS (