DBI, savepoints, transactions, and AutoCommit - Mailing list pgsql-novice

From felix@crowfix.com
Subject DBI, savepoints, transactions, and AutoCommit
Date
Msg-id 20111102201440.GF5551@crowfix.com
Whole thread Raw
Responses Re: DBI, savepoints, transactions, and AutoCommit  (Daniel Staal <DStaal@usa.net>)
List pgsql-novice
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.

Is this a case of what's sauce for the goose not being sauce for the
gander?

How do I use savepoints in DBI/DBD::Pg without enabling AutoCommit?
Do I turn AutoCommit on, BEGIN WORK, SAVEPOINT xyzzy, and disable
AutoCommit again?  That sure doesn't sound reasonable.

(I also have tis problem with SQLite, so I suspect it's a brain
failure on my part rather than the rest of the world conspiring to
confuse me, which isn't even very hard to do.)

--
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
  GPG = E987 4493 C860 246C 3B1E  6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o

pgsql-novice by date:

Previous
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: WARNING: pgstat wait timeout
Next
From: Daniel Staal
Date:
Subject: Re: DBI, savepoints, transactions, and AutoCommit