From: Pavan D. <pav...@gm...> - 2013-09-04 11:14:17
|
On Wed, Sep 4, 2013 at 11:08 AM, Amit Khandekar < ami...@en...> wrote: > Just to keep everyone aware... to support savepoints, it is required to > implement the underlying functionality, namely subtransactions. > Subtransactions are used in multiples scenarios. Besides savepoints, the > procedural languages like pl/pgsql and pl/perl also use subtransactions. > Due to the lack of subtransaction support, the exception blocks in pl/pgsql > do not work currently. > Right. One reason why I delayed implementing SAVEPOINT and subtraction support when I initially wrote transaction management is because first we did not have a way for datanodes to talk to GTM directly. Subsequently we added that for auto vacuum etc. Apart from that, especially for internal subtransaction, we will need careful deliberation since such transactions will not be visible on the coordinators. > So rather than propagating SAVEPOINT command to the cluster nodes, we need > to propagate some commands at some point when CommitSubTransaction() and > BeginInternalSubTransaction() are called. There is currently no explicit > SQL command to commit a subtransaction, or start a subtransaction. > SAVEPOINT command can be used to begin a remote subtransaction block. > Right. That's what we would need. > But there does not seem to be a way to commit that sub-transaction block > remotely. > > Well, you can use RELEASE SAVEPOINT to commit a subtransaction and ROLLBACK TO SAVEPOINT to abort it. BTW, named and unnamed savepoints will also need special handling. My 2 cents. Thanks, Pavan -- Pavan Deolasee http://www.linkedin.com/in/pavandeolasee |