So far, a nested CALL or DO in PL/pgSQL would not establish a context
where transaction control statements were allowed. This patch fixes
that by handling CALL and DO specially in PL/pgSQL, passing the
atomic/nonatomic execution context through and doing the required
management around transaction boundaries.
This requires a new flag in SPI to run SPI_execute* without snapshot
management. This currently poked directly into the plan struct,
requiring access to spi_priv.h. This could use some refinement ideas.
Other PLs are currently not supported, but they could be extended in the
future using the principles being worked out here.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services