Understanding autocommit - Mailing list pgsql-general

From Chris Angelico
Subject Understanding autocommit
Date
Msg-id CAPTjJmqkSabVm09wuMy_71KEsM3ekZRv+=Hn48Sj=xRG5oPG+w@mail.gmail.com
Whole thread Raw
Responses Re: Understanding autocommit
List pgsql-general
I'm looking at these two pages:

http://www.postgresql.org/docs/9.1/static/ecpg-sql-set-autocommit.html
http://www.postgresql.org/docs/9.1/static/sql-start-transaction.html

According to the first page, autocommit is off by default for
"embedded SQL programs". Does this mean everything except the 'psql'
command line interpreter, or is that some special case, and most
programs default to autocommit on?

Currently, I have explicit 'begin' statements in all our code. What
I'd like to achieve is DB2-style semantics where a transaction is
automatically and implicitly opened as soon as any query is performed,
and that transaction remains until committed or rolled back (or until
end of session implicit rollback).

I'm sure there's something really obvious here, but... how do I find
out whether my program's running in autocommit mode or not?

Thanks!

Chris Angelico


pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Amazon High I/O instances
Next
From: "Albe Laurenz"
Date:
Subject: Re: Understanding autocommit