John Frank <jrf(at)segovia(dot)mit(dot)edu> writes:
> this works if the "begin work;" and "declare ...;" are in separate exec
> requests.
This is fixed for 7.1. The problem in 7.0 is that the check for "are we
inside a transaction block?" is done at the wrong time, ie, during
initial parsing of the query string ...
regards, tom lane