Home > database >  client-initiated transactions that closed without COMMIT postgresql
client-initiated transactions that closed without COMMIT postgresql

Time:11-08

I'm using pg in nodejs, my question is very basic but I can't find official documentation about it, what happens with a transaction that was started by a client that ended its connection without issuing COMMIT?

When there are transactions without confirmation, they simply do ROLLBACK when closing the connection of the client that gave BEGIN?

CodePudding user response:

I actually find it documented nowhere, but if the connection is terminated before you commit, the transaction is automatically rolled back. That's a basic requirement for a relational database.

  • Related