Mercurial > hg > ZDBInterface
comparison DBInterface.py @ 18:60fea3a6c695
better fix for psycopg 2.4. better quoting of sql arguments.
author | casties |
---|---|
date | Thu, 23 Feb 2012 21:17:14 +0100 |
parents | 5b99c04c567c |
children | 132ae1c0255a |
comparison
equal
deleted
inserted
replaced
17:48ed91b29784 | 18:60fea3a6c695 |
---|---|
169 args = (args,) | 169 args = (args,) |
170 | 170 |
171 cur.execute(query, args) | 171 cur.execute(query, args) |
172 # description of returned fields | 172 # description of returned fields |
173 fields = cur.description | 173 fields = cur.description |
174 logging.debug("fields: %s"%repr(fields)) | 174 #logging.debug("fields: %s"%repr(fields)) |
175 if len(fields) > 0: | 175 if len(fields) > 0: |
176 # re-pack Column object in tuple | 176 # re-pack Column object in tuple |
177 fields = (f[0:] for f in fields) | 177 fs = [] |
178 logging.debug("re-packed fields: %s"%repr(fields)) | 178 for f in fields: |
179 fs.append(f[0:]) | |
180 | |
181 fields = fs | |
182 #logging.debug("re-packed fields: %s"%repr(fields)) | |
179 | 183 |
180 if hasResult: | 184 if hasResult: |
181 # get all data in an array | 185 # get all data in an array |
182 data = cur.fetchall() | 186 data = cur.fetchall() |
183 cur.close() | 187 cur.close() |