From b0de37d4f91b2d41d10ace250aa41f5531b6f6f7 Mon Sep 17 00:00:00 2001 From: simon987 Date: Thu, 20 Aug 2020 21:10:31 -0400 Subject: [PATCH] Fix pg cursor --- hexlib/db.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hexlib/db.py b/hexlib/db.py index 71da664..ad2f781 100644 --- a/hexlib/db.py +++ b/hexlib/db.py @@ -134,7 +134,7 @@ def _deserialize(value, col_type): def pg_fetch_cursor_all(cur, name, batch_size=1000): while True: - cur.execute("FETCH FORWARD %s FROM %s", (batch_size, name)) + cur.execute("FETCH FORWARD %d FROM %s" % (batch_size, name)) cnt = 0 for row in cur: @@ -142,7 +142,7 @@ def pg_fetch_cursor_all(cur, name, batch_size=1000): yield row if cnt != batch_size: - cur.execute("FETCH ALL FROM %s", (batch_size, name)) + cur.execute("FETCH ALL FROM %s" % (name,)) for row in cur: yield row break diff --git a/setup.py b/setup.py index b85f9ee..3aba8b0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name="hexlib", - version="1.16", + version="1.17", description="Misc utility methods", author="simon987", author_email="me@simon987.net",