Per discussion in [1], this patch improves error reporting in pltcl.
I forgot to mention that this work is sponsored by Flight Aware (http://flightaware.com).
Huh ... I use that site. There's PG and pltcl code behind it? Cool!
I didn't study this patch deeper yet. Just I am sending rebased code
I found one issue. The context
+ ERROR: relation "foo" does not exist + CONTEXT: relation "foo" does not exist + while executing + "spi_exec "select * from foo;"" + ("eval" body line 1) + invoked from within + "eval $1" + (procedure "__PLTcl_proc_16461" line 3) + invoked from within + "__PLTcl_proc_16461 {spi_exec "select * from foo;"}" + in PL/Tcl function "tcl_eval"
is changed in any call - when I did "make installcheck"
*** 567,575 **** ("eval" body line 1) invoked from within "eval $1" ! (procedure "__PLTcl_proc_16461" line 3) invoked from within ! "__PLTcl_proc_16461 {spi_exec "select * from foo;"}" in PL/Tcl function "tcl_eval" select pg_temp.tcl_eval($$ set list [lindex $::errorCode 0]; --- 567,575 ---- ("eval" body line 1) invoked from within "eval $1" ! (procedure "__PLTcl_proc_16841" line 3) <<<<<==================== _PLTcl_proc_XXXX invoked from within ! "__PLTcl_proc_16841 {spi_exec "select * from foo;"}" in PL/Tcl function "tcl_eval" select pg_temp.tcl_eval($$ set list [lindex $::errorCode 0];
I am not able to see, if this information is interesting or not. We can hide context, but I have not a idea, if it is ok or not.