Fix query mogrify issue.

pull/5917/head
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
1 changed files with 2 additions and 3 deletions

View File

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