使用Python将数组列表插入数据库psql [英] Insert array list into database psql using Python
本文介绍了使用Python将数组列表插入数据库psql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,我有一个关于数据库的问题:
i有一个表包含id,name,username.and这样的rray列表
data = [(1, 'jhon','jj'),(2,'bob','bb'),(3,'fd','fd')]
i希望将此数组插入到数据库中一次(只有一个查询)。
任何帮助?
我尝试了什么:
i用于循环,但需要时间!
hello i have a question about database:
i have a table contain id , name , username.and an rray list like this one
data=[(1,'jhon','jj'),(2,'bob','bb'),(3,'fd','fd')]
i want to insert this array into the database at once (only one query).
any help ?
What I have tried:
i used for loop but it take times!
推荐答案
检查出来: Bulk使用Django和PostgreSQL插入性能 [ ^ ]
这篇关于使用Python将数组列表插入数据库psql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文