Content-Length: 1100 | pFad | http://github.com/postgrespro/testgres/pull/110.patch
thub.com
From e890625a239d1bcfd7258e21150ae294b30d28e4 Mon Sep 17 00:00:00 2001
From: "z.kasymalieva"
Date: Thu, 1 Feb 2024 16:38:31 +0300
Subject: [PATCH] fix Error executing query
---
testgres/connection.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/testgres/connection.py b/testgres/connection.py
index 882498a9..49b74844 100644
--- a/testgres/connection.py
+++ b/testgres/connection.py
@@ -104,13 +104,13 @@ def rollback(self):
def execute(self, query, *args):
self.cursor.execute(query, args)
try:
- res = self.cursor.fetchall()
# pg8000 might return tuples
- if isinstance(res, tuple):
- res = [tuple(t) for t in res]
-
+ res = [tuple(t) for t in self.cursor.fetchall()]
return res
- except Exception:
+ except ProgrammingError:
+ return None
+ except Exception as e:
+ print("Error executing query: {}\n {}".format(repr(e), query))
return None
def close(self):
--- a PPN by Garber Painting Akron. With Image Size Reduction included!Fetched URL: http://github.com/postgrespro/testgres/pull/110.patch
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy