data = [(1, 'x'), (2, 'y')]
insert_query = 'insert into t (a, b) values %',
psycopg2.extras.execute_values(cursor, insert_query, data, template=None,
    page_size=100)
psycopg2: insert multiple rows with one query