aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-10-04 15:47:41 +0000
committerBruce Momjian <bruce@momjian.us>2001-10-04 15:47:41 +0000
commit25ec48472233e771c53a174fd53a8bd9ac0e5199 (patch)
tree40fa4d806ff93f704fba37b8db99dcd94ae6bf83 /src
parent60553337d72f73d663f46d0e6a62e8c81077b322 (diff)
downloadpostgresql-25ec48472233e771c53a174fd53a8bd9ac0e5199.tar.gz
postgresql-25ec48472233e771c53a174fd53a8bd9ac0e5199.zip
This patch adds reporting of tcl global variable errorInfo
which contains stack trace. One problem, after this patch errors will generate multiline ERROR messages. Is it acceptable or do I need split it and generate multiple singleline messages? Vsevolod Lobko
Diffstat (limited to 'src')
-rw-r--r--src/pl/tcl/pltcl.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 5800320615c..73c5247e3c5 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.40 2001/10/01 15:33:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.41 2001/10/04 15:47:41 momjian Exp $
*
**********************************************************************/
@@ -789,7 +789,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0;
- elog(ERROR, "pltcl: %s", interp->result);
+ UTF_BEGIN;
+ elog(ERROR, "pltcl: %s\n%s", interp->result,
+ UTF_U2E(Tcl_GetVar(interp,"errorInfo",
+ TCL_GLOBAL_ONLY)));
+ UTF_END;
}
if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0;
@@ -1162,7 +1166,11 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS)
pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0;
- elog(ERROR, "pltcl: %s", interp->result);
+ UTF_BEGIN;
+ elog(ERROR, "pltcl: %s\n%s", interp->result,
+ UTF_U2E(Tcl_GetVar(interp,"errorInfo",
+ TCL_GLOBAL_ONLY)));
+ UTF_END;
}
if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0;