Show failing OID in 'cache lookup failed' messages;

print OIDs as %u not %d.
This commit is contained in:
Tom Lane 2000-04-16 04:19:41 +00:00
parent 1460dd0eff
commit 215c60dc21
2 changed files with 29 additions and 21 deletions

View File

@ -513,7 +513,8 @@ plperl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "plperl: cache lookup from pg_proc failed"); elog(ERROR, "plperl: cache lookup for proc %u failed",
proinfo->fn_oid);
} }
procStruct = (Form_pg_proc) GETSTRUCT(procTup); procStruct = (Form_pg_proc) GETSTRUCT(procTup);
@ -528,7 +529,8 @@ plperl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "plperl: cache lookup for return type failed"); elog(ERROR, "plperl: cache lookup for return type %u failed",
procStruct->prorettype);
} }
typeStruct = (Form_pg_type) GETSTRUCT(typeTup); typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
@ -558,7 +560,8 @@ plperl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "plperl: cache lookup for argument type failed"); elog(ERROR, "plperl: cache lookup for argument type %u failed",
procStruct->proargtypes[i]);
} }
typeStruct = (Form_pg_type) GETSTRUCT(typeTup); typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
@ -745,7 +748,8 @@ plperl_trigger_handler(FmgrInfo *proinfo)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "plperl: cache lookup from pg_proc failed"); elog(ERROR, "plperl: cache lookup for proc %u failed",
proinfo->fn_oid);
} }
procStruct = (Form_pg_proc) GETSTRUCT(procTup); procStruct = (Form_pg_proc) GETSTRUCT(procTup);
@ -1064,9 +1068,9 @@ plperl_trigger_handler(FmgrInfo *proinfo)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
ret_values[--i], ret_values[--i],
ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid)); tupdesc->attrs[attnum - 1]->atttypid);
} }
typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput); typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput);
typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem); typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem);
@ -2081,8 +2085,8 @@ plperl_set_tuple_values(Tcl_Interp *interp, char *arrayname,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid)); attname, tupdesc->attrs[i]->atttypid);
} }
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput); typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);
@ -2157,8 +2161,8 @@ plperl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid)); attname, tupdesc->attrs[i]->atttypid);
} }
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput); typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);

View File

@ -3,7 +3,7 @@
* procedural language (PL) * procedural language (PL)
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.20 2000/04/12 17:17:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.21 2000/04/16 04:19:41 tgl Exp $
* *
* This software is copyrighted by Jan Wieck - Hamburg. * This software is copyrighted by Jan Wieck - Hamburg.
* *
@ -473,7 +473,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "pltcl: cache lookup from pg_proc failed"); elog(ERROR, "pltcl: cache lookup for proc %u failed",
proinfo->fn_oid);
} }
procStruct = (Form_pg_proc) GETSTRUCT(procTup); procStruct = (Form_pg_proc) GETSTRUCT(procTup);
@ -488,7 +489,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "pltcl: cache lookup for return type failed"); elog(ERROR, "pltcl: cache lookup for return type %u failed",
procStruct->prorettype);
} }
typeStruct = (Form_pg_type) GETSTRUCT(typeTup); typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
@ -517,7 +519,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "pltcl: cache lookup for argument type failed"); elog(ERROR, "pltcl: cache lookup for argument type %u failed",
procStruct->proargtypes[i]);
} }
typeStruct = (Form_pg_type) GETSTRUCT(typeTup); typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
@ -803,7 +806,8 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
{ {
free(prodesc->proname); free(prodesc->proname);
free(prodesc); free(prodesc);
elog(ERROR, "pltcl: cache lookup from pg_proc failed"); elog(ERROR, "pltcl: cache lookup for proc %u failed",
proinfo->fn_oid);
} }
procStruct = (Form_pg_proc) GETSTRUCT(procTup); procStruct = (Form_pg_proc) GETSTRUCT(procTup);
@ -1123,9 +1127,9 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
ret_values[--i], ret_values[--i],
ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid)); tupdesc->attrs[attnum - 1]->atttypid);
} }
typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput); typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput);
typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem); typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem);
@ -2137,8 +2141,8 @@ pltcl_set_tuple_values(Tcl_Interp *interp, char *arrayname,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid)); attname, tupdesc->attrs[i]->atttypid);
} }
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput); typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);
@ -2210,8 +2214,8 @@ pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc,
0, 0, 0); 0, 0, 0);
if (!HeapTupleIsValid(typeTup)) if (!HeapTupleIsValid(typeTup))
{ {
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed", elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid)); attname, tupdesc->attrs[i]->atttypid);
} }
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput); typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);