Joe Conway <mail@joeconway.com> writes:
> Specifically I'd like to reset a variable within my PL/R interpreter
> each time a new SQL statement begins.
Define "new SQL statement". In particular, what of a PL function
executing multiple SQL statements inside an outer SQL statement that
invoked the function? Unless you've got a clear idea of the semantics
you want, it's not going to be very profitable to discuss
implementations ...
regards, tom lane