3 ms·
I thought that autocommit simply wraps each SQL statement in its own transaction? Wouldn't a good programming practice, be to ensure that everything that is su
by patrickgzill 14y ago
I thought that autocommit simply wraps each SQL statement in its own transaction? Wouldn't a good programming practice, be to ensure that everything that is supposed to be atomic, occur in a single, possibly large, SQL statement anyways?
- jpitz 14y agoAutocommit omits the begin/commit pair. This is 'implicit' transaction mode. There is no way to turn off transactions in postgres. The performance savings comes from the roundtrip latency of the BEGIN TRANSACTION / COMMIT packets. "Wouldn't a good programming practice, be to ensure that everything that is supposed to be atomic, occur in a single, possibly large, SQL statement anyways?" The simplistic answer to that question is a resounding yes.