mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
I'm sending you a small patch to pgdb.py module. This
raises pgdb.DatabaseError when any of the fetch* methods was invoked but previous call to execute* did not produce any result set or no call was issued yet. Also, raises pgdb.NotSupportedError when .nextset() is invoked, instead of NameError. This behaviour complies with DB-API 2.0. Thanks for your work! Timur Irmatov.
This commit is contained in:
parent
a4bc5eeef2
commit
200dd8e3f8
@ -240,7 +240,10 @@ class pgdbCursor:
|
|||||||
size = self.arraysize
|
size = self.arraysize
|
||||||
if keep == 1:
|
if keep == 1:
|
||||||
self.arraysize = size
|
self.arraysize = size
|
||||||
res = self.__source.fetch(size)
|
|
||||||
|
try: res = self.__source.fetch(size)
|
||||||
|
except _pg.error, e: raise DatabaseError, str(e)
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for r in res:
|
for r in res:
|
||||||
row = []
|
row = []
|
||||||
@ -253,6 +256,9 @@ class pgdbCursor:
|
|||||||
result.append(row)
|
result.append(row)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def nextset(self):
|
||||||
|
raise NotSupportedError, "nextset() is not supported"
|
||||||
|
|
||||||
def setinputsizes(self, sizes):
|
def setinputsizes(self, sizes):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user