I'm trying to load sparse vectors into a table managed by PostgreSQL. For simplicity, let's suppose that the table has only two fields: a vector ID and the vector itself (which is the result of applying sklearn's TF-IDF). As far as I understand, the most efficient way to load a lot of data into a table is to use COPY FROM, which is supported for sparse vectors by the pgvector extension. The documentation for pgvector contains an example of how to use COPY FROM with vectors, and the example utilizes psycopg. Is there support for COPY FROM with FORMAT BINARY in peewee? I've seen bulk_create() and insert_many(), but I'm not sure how to use them in my case. Can they use FORMAT BINARY and, if so, how to utilize the format? Continue reading...