mirror of
https://github.com/ansible/awx.git
synced 2026-05-22 16:27:42 -02:30
Replacing psycopg2.copy_expert with psycopg3.copy
This commit is contained in:
committed by
John Westcott IV
parent
e47d30974c
commit
a665d96026
@@ -399,7 +399,10 @@ def _copy_table(table, query, path):
|
||||
file_path = os.path.join(path, table + '_table.csv')
|
||||
file = FileSplitter(filespec=file_path)
|
||||
with connection.cursor() as cursor:
|
||||
cursor.copy_expert(query, file)
|
||||
with cursor.copy(query) as copy:
|
||||
while data := copy.read():
|
||||
byte_data = bytes(data)
|
||||
file.write(byte_data.decode())
|
||||
return file.file_list()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user