On 2/28/07, Martin Gainty <[EMAIL PROTECTED]> wrote:

yep--
Aparently postgres thinks its smarter than anyone that wants to use it and
has Auto-commit ALWAYS turned on
If you find a way to turn this *feature* off let me know because it is
massively counter intuitive to normal operation of any other db on the
planet



I'm not sure about PostgreSQL, but Informix has a somewhat similar mode - or
two somewhat similar modes.  An unlogged (Informix) database has no
transaction support at all; you cannot do transactions, and each statement
is nominally a self-contained transaction (except that if an error occurs
part way through, the changes made so far are not undone - for DML
statements).  In a regular logged database, each statement is a separate
transaction - complete with rollback so that if a statement fails part way
through, the database is left as if the statement had never been executed.
In a logged database, you can suppress the auto-commit mode by an explicit
BEGIN WORK statement.  This begins a (multi-statement) transaction that is
terminated by COMMIT WORK or ROLLBACK WORK.  If something happens to the
client before COMMIT is executed, the transaction is rolled back.

It doesn't take a lot of searching around the PostgreSQL documentation to
find:

BEGIN -- start a transaction blockSynopsis

BEGIN [ WORK | TRANSACTION ] [ *transaction_mode* [, ...] ]

where *transaction_mode* is one of:

   ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED
| READ UNCOMMITTED }
   READ WRITE | READ ONLY


I suspect you'll find that this 'turns off autocommit' for you.

--
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2007.0226 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to