How do you set autocommit off in psql 8.4 at a global level? is there a configuration attribute that i can change that will introduce this behaviour for all dbs on a cluster to start db sessions with autocommit off?
Simply add the following to ~/.psqlrc
:
\set AUTOCOMMIT off
Note that this only works when using the psql
shell! I assume this is what you are talking about?
Use a transaction if you want want a (open) transaction:
BEGIN;
INSERT ...;
UPDATE ...;
COMMIT; -- when you're done
BEGIN
an explicit transaction if you don't want autocommit. – Craig Ringer Dec 12 '12 at 11:44