Re: do I need a rollback() after commit that fails?

From: Vick Khera <vivek(at)khera(dot)org>
To: Andy Colson <andy(at)squeakycode(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: do I need a rollback() after commit that fails?
Date: 2009-09-30 02:01:36
Message-ID: 2968dfd60909291901y53971e23nde72847742590004@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 29, 2009 at 3:56 PM, Andy Colson <andy(at)squeakycode(dot)net> wrote:
> Unless I'm mistaken, if AutoCommit is enabled, then each statement will be
> commit for you.  The commit() and the rollback() are both useless.
>

To clarify, the DBI driver turns off AutoCommit in postgres when
begin_work() is called. It does not however disable its internal
AutoCommit flag.

The question still stands: if the COMMIT fails, ROLLBACK is not
required in Postgres. Is this portable to other databases?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-09-30 02:17:22 Re: query is taking longer time after a while
Previous Message Vick Khera 2009-09-30 01:58:05 Re: query is taking longer time after a while