Re: Improve error handling in pltcl - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Improve error handling in pltcl
Date
Msg-id CAFj8pRC-ctCzs68kL-04PGNjuRKQ9yGJr_dTaOz4rD5OXXi0nw@mail.gmail.com
Whole thread Raw
In response to Re: Improve error handling in pltcl  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Improve error handling in pltcl
List pgsql-hackers
Hi

2016-03-01 22:23 GMT+01:00 Jim Nasby <Jim.Nasby@bluetreble.com>:
On 2/29/16 10:01 PM, Tom Lane wrote:
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
On 2/28/16 5:50 PM, Jim Nasby wrote:
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.

Regards

Pavel

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: VS 2015 support in src/tools/msvc
Next
From: Teodor Sigaev
Date:
Subject: Re: WIP: Upper planner pathification