On 16 January 2017 at 23:29, Christophe Pettus <xof@thebuild.com> wrote:
> On Jan 16, 2017, at 15:26, Daniel Fortunov <psycopg-list@danielfortunov.com> wrote: > > I'd like to implement support for nested transactions in psycopg2 using a context manager that internally uses postgres savepoints to implement the ability to nest transactions within each other, with sensible commit and rollback semantics.
You can see two existing examples of this, based on Django. Django implements the @atomic() decorator, which was based on my @xact() decorator: