AttributeError: 'psycopg2.extensions.cursor' object has no attribute 'fast_executemany'
to_sql() is too slow. so trying to resolve the problem. but when I run the following code I am getting :-
AttributeError: 'psycopg2.extensions.cursor' object has no attribute 'fast_executemany'
@event.listens_for(conn, 'before_cursor_execute')
def receive_before_cursor_execute(conn, cursor, statement, params, context, executemany):
if executemany:
cursor.fast_executemany = True
cursor.commit()