Fix query mogrify issue.

This commit is contained in:
Khushboo Vashi 2023-03-06 16:57:31 +05:30 committed by GitHub
parent 9b7a38ac52
commit c35d449d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1017,7 +1017,6 @@ WHERE db.datname = current_database()""")
encoding = self.python_encoding
query = query.encode(encoding)
self.__async_cursor = cur
self.__async_query_id = query_id
@ -1814,7 +1813,7 @@ Failed to reset the connection to the server due to following error:
else:
if parameters:
return psycopg.sql.SQL(query.format(parameters)
).as_string(self.conn)
with psycopg.ClientCursor(self.conn) as _cur:
return _cur.mogrify(query, parameters)
else:
return query