From f7884f5e2ffb73348bb4d8e4721c9c713dec9e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Thu, 4 Dec 2025 21:36:46 +0100 Subject: [PATCH] fix delete with pooler --- hindsight-api/hindsight_api/engine/memory_engine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hindsight-api/hindsight_api/engine/memory_engine.py b/hindsight-api/hindsight_api/engine/memory_engine.py index 5ec6483b..ef63e175 100644 --- a/hindsight-api/hindsight_api/engine/memory_engine.py +++ b/hindsight-api/hindsight_api/engine/memory_engine.py @@ -1689,6 +1689,8 @@ class MemoryEngine: """ pool = await self._get_pool() async with acquire_with_retry(pool) as conn: + # Ensure connection is not in read-only mode (can happen with connection poolers) + await conn.execute("SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE") async with conn.transaction(): try: if fact_type: