In PL/Tcl, make database errors return additional info in the errorCode.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fb8d2a7f57d87102f0a95025fbf1cad9c341739b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2016-03-25T19:52:53Z
Releases: 9.6.0
In PL/Tcl, make database errors return additional info in the errorCode.

Tcl has a convention for returning additional info about an error in a
global variable named errorCode.  Up to now PL/Tcl has ignored that,
but this patch causes database errors caught by PL/Tcl to fill in
errorCode with useful information from the ErrorData struct.

Jim Nasby, reviewed by Pavel Stehule and myself

Files

PathChange+/−
doc/src/sgml/pltcl.sgml modified +72 −2
src/pl/tcl/expected/pltcl_setup.out modified +28 −0
src/pl/tcl/pltcl.c modified +148 −3
src/pl/tcl/sql/pltcl_setup.sql modified +24 −0

Documentation touched