How can I use psycopg2.extras in sqlalchemy?

后端 未结 2 1662
南方客
南方客 2020-11-27 08:26

I want to upload a huge number of entries (~600k) into a simple table in a PostgreSQL DB, with one foreign key, a timestamp and 3 float per each entry. However, it takes 60

2条回答
  •  再見小時候
    2020-11-27 09:06

    Meanwhile it became possible (from SqlAlchemy 1.2.0) with the use_batch_mode flag on the create_engine() function. See the docs. It uses the execute_batch() function from psycopg.extras.

提交回复
热议问题