> >But 'BEGIN' in plpgsql does not start a [sub]transaction, it starts a > >statement block. Are we intending to change that ? I think not. > > > > > > > There are two possibilities: > Either BEGIN *does* start a subtransaction, or BEGIN does not. I don't > see how two nesting level hierarchies in a function should be > handleable, i.e. having independent levels of statements blocks and > subtransactions. > > BEGIN [whatever] suggests that there's also a statement closing that > block of [whatever], but it's very legal for subtransactions to have no > explicit end; the top level COMMIT does it all.
An 'END SUB' after a 'BEGIN SUB' in plpgsql could be required, and could mean start/end block and subtx. I do not really see a downside. But, it would imho only make sense if the 'END SUB' would commit sub or abort sub iff subtx is in aborted state (see my prev posting) Andreas ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html