Re: DBI, savepoints, transactions, and AutoCommit

From: Daniel Staal <DStaal(at)usa(dot)net>
To: felix(at)crowfix(dot)com, pgsql-novice(at)postgresql(dot)org
Subject: Re: DBI, savepoints, transactions, and AutoCommit
Date: 2011-11-02 22:05:56
Message-ID: 3D1BB8560FFF5D7C4B9682FF@mac-pro.magehandbook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

--As of November 2, 2011 1:14:40 PM -0700, felix(at)crowfix(dot)com is alleged to
have said:

> I understand the concepts of savepoints, and I have played with them
> in psql enough to understand that yes, as the fine manual says, they
> must be inside a transaction to work. But how does this relate to DBI
> and DBD::Pg with AutoCommit off? I learned the slow way that if
> AutoCommit is disabled, you don't issue a BEGIN WORK because that
> looks like trying to start a transaction inside a transaction. But I
> I have AutoCommit off and try SAVEPOINT xyzzy, it tells me savepoints
> must be inside a transaction. And of course, I can't get inside a
> transaction because I can't issue a BEGIN WORK because I am already
> inside a transaction.

--As for the rest, it is mine.

Sounds like you are doing things right. What versions of the following are
you using?
DBI
DBD::Pg
Postgres

Also, do you have any example code that shows the problem?

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Doug Wiebe 2011-11-02 22:33:54 Foreign key constraint violation when using table inheritance
Previous Message felix 2011-11-02 20:14:40 DBI, savepoints, transactions, and AutoCommit