Hi, Markus. Thanks for expanding upon my patch, which was very minimal
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
> 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
> The original patch from  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).