Alvaro Herrera <[EMAIL PROTECTED]> writes:
>> Attached is the savepoints syntax patch, hopefully last try.
>> - Tab completion patch from Gaetano is included.

Reviewed and committed.

I did not apply your changes to spi.c, instead choosing to revert it to
the former coding that disallowed any TransactionStmts.  I don't think
it will possibly work for SPI to execute such commands: if it did,
control would return to the caller with a different active transaction,
different active memory context, etc.

Oracle's PL/SQL behavior seems to posit that the PL/SQL function
executes "outside the database" and can have local state that is not
affected by SAVEPOINT, ROLLBACK, et al.  I'm not sure if we really
want to support that, but in any case there's no chance of doing it
for 7.5.  Our functions very definitely execute inside transactions.

What we could do at the SPI level is to provide functions that
encapsulate start-subxact/execute-command/commit-or-abort-subxact
so that control returns in the same subxact you started in, and you
can get control back if the executed command fails.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?


Reply via email to