Thomas Hallgren <thhal@mailblocks.com> writes:
> In a PL language it's sometimes desirable to prevent execution of some
> commands. I would like to prevent the commands "begin [work or
> transaction]", "commit", and "rollback", completely and I would like to
> force the user to use explicit methods for the savepoint methods.
If you are executing through SPI then those operations are disallowed
already.
> I wonder if there's any way to extract the nature of a command from the
> execution plan returned by SPI_prepare. If not, would it be very
> difficult to add?
The main problem with this proposal is the erroneous assumption that
there can be only one command in a SPI plan.
regards, tom lane