Psycopg2, Postgresql, Python: Fastest way to bulk-insert

前端 未结 8 1387
轻奢々
轻奢々 2020-11-30 22:48

I\'m looking for the most efficient way to bulk-insert some millions of tuples into a database. I\'m using Python, PostgreSQL and psycopg2.

I have created a long lis

8条回答
  •  情话喂你
    2020-11-30 23:18

    Yeah, I would vote for COPY, providing you can write a file to the server's hard drive (not the drive the app is running on) as COPY will only read off the server.

提交回复
热议问题