Postgres setting autocommit off globally

ajeeshpu picture ajeeshpu · Dec 12, 2012 · Viewed 12.6k times · Source

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?

Answer

exhuma picture exhuma · Oct 18, 2013

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?