Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible multiple connections per one transaction in Postgres? Golang usage

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

like image 356
MasterJ Avatar asked Dec 30 '25 01:12

MasterJ


1 Answers

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"

like image 177
Андрей Николаев Avatar answered Jan 01 '26 19:01

Андрей Николаев



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!