Re: Savepoint or subtransaction support

Clarence Gardner <[email protected]> Fri, 06 Oct 2006 07:55:49 -0700
Newsgroups gmane.comp.python.db.pypgsql.user
Organization AdECN, Inc.
Message-ID <[email protected]>
Hi, Markus. Thanks for expanding upon my patch, which was very minimal 
(=lazy) and
pretty much did just what I needed. Although since apparently nobody 
ever used savepoints
while using pypgsql (which we know because if you tried to use them 
yourself, the library would get in the way), I didn't feel *too* bad 
about it.

> I've modified my patch to support multiple savepoints. I'm now using 
> the same methods as the original patch (i.e. savepoint, release and 
> rollback)
>
> The original patch from [1] did release a savepoint if it already 
> existed. I think that's dangerous. In fact, PostgreSQL even allows to 
> define multiple savepoints with the very same name.
Actually, PostgreSQL is following the SQL standard in that respect. 
Given that, I think your patch has an error when it's searching for the 
savepoint name to rollback to. In case the same name is currently active 
more than once, you want to search from the end of your list of 
savepoint names rather than from the beginning (since savepoint() 
appends to the list).
>
> (I've tried to upload the page to the 'patches' page on SourceForge, 
> but didn't succeed, I've only added a useless comment, sorry. Please 
> bear with a SF-first-timer.)
>
I had what may be the same problem. Even if you set the file to upload, 
the server ignores it unless you check the checkbox labeled "Upload 
file" (or something).

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV