英文:
Is it possible multiple connections per one transaction in Postgres? Golang usage
问题
我需要使用多个连接并在单个事务范围内同时填充Postgres中的表格。这种做法可行吗?
我没有看到任何避免这个瓶颈的方法。
谢谢。
英文:
I need to populate table in Postgres concurrently by using multiple connections but in scope of single transaction. Is it possible?
I don't see any way to avoid this bottleneck.
Thanks
答案1
得分: 1
我相信这个交易是不需要的。
但是如果非常想要的话,你可以创建一个临时表,用几个例程填充它,然后在一个事务中使用"insert from select"的方式批量传输数据。
英文:
I am confident that the transaction did not need to.
But if much want to - you can make a staging table, fill it with several routines, and then in a transaction to transfer data in bulk by using such "insert from select"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论