Thread: pl/tcl again.

pl/tcl again.

From
ohp@pyrenet.fr
Date:
Hi all,

I'm still fighting with pltcl test that doesn't return the error message
when "elog ERROR "message" is called.

I've played witrh pltcl.c pltcl_error and removed the calls to PG_TRY,
PG_CATCH and PG_ENDTRY to proove that elog it self had a problem...

How can I check what happens in elog?

Each time elog is called with a level of ERROR,FATAL, PG_CATCH runs.

Also here are the server logs for pltcl checks.

It's amazing that the actual error message is in context...


LOG:  database system was shut down at 2006-06-19 16:48:47 MET DST
LOG:  checkpoint record is at 0/22C6CE0
LOG:  redo record is at 0/22C6CE0; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 9130; next OID: 38895
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
LOG:  transaction ID wrap limit is 1073745208, limited by database "regression"
LOG:  transaction ID wrap limit is 1073745208, limited by database "regression"
LOG:  transaction ID wrap limit is 1073745208, limited by database "regression"
ERROR:  role "regressgroup1" does not exist
ERROR:
CONTEXT:  duplicate key '1', 'KEY1-3' for T_pkey2    while executing"elog ERROR  "duplicate key '$NEW(key1)',
'$NEW(key2)'for T_pkey2""    invoked from within"if {$n > 0} {    elog ERROR \        "duplicate key '$NEW(key1)',
'$NEW(key2)'for T_pkey2"    }"    (procedure "__PLTcl_proc_38909_trigger_38900" line 32)    invoked from
within"__PLTcl_proc_38909_trigger_38900pkey2_before 38900 {{} key1 key2 txt} BEFORE ROW INSERT {key1 1 key2 {KEY1-3
        } txt {should fail         ..."
 
ERROR:
CONTEXT:  key for t_dta1 not in t_pkey1    while executing"elog ERROR "key for $GD($planrel) not in $keyrel""
(procedure"__PLTcl_proc_38913_trigger_38902" line 92)    invoked from within"__PLTcl_proc_38913_trigger_38902
dta1_before38902 {{} tkey ref1 ref2} BEFORE ROW INSERT {tkey {trec 4    } ref1 1 ref2 {key1-4              }} {}
ref..."
ERROR:
CONTEXT:  key for t_dta2 not in t_pkey2    while executing"elog ERROR "key for $GD($planrel) not in $keyrel""
(procedure"__PLTcl_proc_38913_trigger_38904" line 92)    invoked from within"__PLTcl_proc_38913_trigger_38904
dta2_before38904 {{} tkey ref1 ref2} BEFORE ROW INSERT {tkey {trec 4    } ref1 1 ref2 {KEY1-4              }} {}
ref..."
ERROR:
CONTEXT:  key '1', 'key1-1              ' referenced by T_dta1    while executing"elog ERROR  "key '$OLD(key1)',
'$OLD(key2)'referenced by T_dta1""    invoked from within"if {$check_old_ref} {    #    # Check for references to OLD
#        set n [spi_execp -count 1 $GD(plan_dta1) [list $OLD(key1) $OLD(key2)]]    if {$n > 0}..."    (procedure
"__PLTcl_proc_38907_trigger_38898"line 79)    invoked from within"__PLTcl_proc_38907_trigger_38898 pkey1_before 38898
{{}key1 key2 txt} BEFORE ROW UPDATE {key1 1 key2 {key1-9              } txt {test key            ..."
 
ERROR:
CONTEXT:  key '1', 'key1-2              ' referenced by T_dta1    while executing"elog ERROR  "key '$OLD(key1)',
'$OLD(key2)'referenced by T_dta1""    invoked from within"if {$check_old_ref} {    #    # Check for references to OLD
#        set n [spi_execp -count 1 $GD(plan_dta1) [list $OLD(key1) $OLD(key2)]]    if {$n > 0}..."    (procedure
"__PLTcl_proc_38907_trigger_38898"line 79)    invoked from within"__PLTcl_proc_38907_trigger_38898 pkey1_before 38898
{{}key1 key2 txt} BEFORE ROW DELETE {} {key1 1 key2 {key1-2              } txt {test key         ..."
 
NOTICE:  updated 1 entries in T_dta2 for new key in T_pkey2
NOTICE:  deleted 1 entries from T_dta2
-- 
Olivier PRENANT                    Tel: +33-5-61-50-97-00 (Work)
15, Chemin des Monges                +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                       +33-6-07-63-80-64 (GSM)
FRANCE                          Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)