Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 215c60d

Browse files
committed
Show failing OID in 'cache lookup failed' messages;
print OIDs as %u not %d.
1 parent 1460dd0 commit 215c60d

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

src/pl/plperl/plperl.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ plperl_func_handler(FmgrInfo *proinfo,
513513
{
514514
free(prodesc->proname);
515515
free(prodesc);
516-
elog(ERROR, "plperl: cache lookup from pg_proc failed");
516+
elog(ERROR, "plperl: cache lookup for proc %u failed",
517+
proinfo->fn_oid);
517518
}
518519
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
519520

@@ -528,7 +529,8 @@ plperl_func_handler(FmgrInfo *proinfo,
528529
{
529530
free(prodesc->proname);
530531
free(prodesc);
531-
elog(ERROR, "plperl: cache lookup for return type failed");
532+
elog(ERROR, "plperl: cache lookup for return type %u failed",
533+
procStruct->prorettype);
532534
}
533535
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
534536

@@ -558,7 +560,8 @@ plperl_func_handler(FmgrInfo *proinfo,
558560
{
559561
free(prodesc->proname);
560562
free(prodesc);
561-
elog(ERROR, "plperl: cache lookup for argument type failed");
563+
elog(ERROR, "plperl: cache lookup for argument type %u failed",
564+
procStruct->proargtypes[i]);
562565
}
563566
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
564567

@@ -745,7 +748,8 @@ plperl_trigger_handler(FmgrInfo *proinfo)
745748
{
746749
free(prodesc->proname);
747750
free(prodesc);
748-
elog(ERROR, "plperl: cache lookup from pg_proc failed");
751+
elog(ERROR, "plperl: cache lookup for proc %u failed",
752+
proinfo->fn_oid);
749753
}
750754
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
751755

@@ -1064,9 +1068,9 @@ plperl_trigger_handler(FmgrInfo *proinfo)
10641068
0, 0, 0);
10651069
if (!HeapTupleIsValid(typeTup))
10661070
{
1067-
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed",
1071+
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
10681072
ret_values[--i],
1069-
ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid));
1073+
tupdesc->attrs[attnum - 1]->atttypid);
10701074
}
10711075
typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput);
10721076
typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem);
@@ -2081,8 +2085,8 @@ plperl_set_tuple_values(Tcl_Interp *interp, char *arrayname,
20812085
0, 0, 0);
20822086
if (!HeapTupleIsValid(typeTup))
20832087
{
2084-
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed",
2085-
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
2088+
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
2089+
attname, tupdesc->attrs[i]->atttypid);
20862090
}
20872091

20882092
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);
@@ -2157,8 +2161,8 @@ plperl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc)
21572161
0, 0, 0);
21582162
if (!HeapTupleIsValid(typeTup))
21592163
{
2160-
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %ld failed",
2161-
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
2164+
elog(ERROR, "plperl: Cache lookup for attribute '%s' type %u failed",
2165+
attname, tupdesc->attrs[i]->atttypid);
21622166
}
21632167

21642168
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);

src/pl/tcl/pltcl.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language (PL)
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.20 2000/04/12 17:17:20 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.21 2000/04/16 04:19:41 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -473,7 +473,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
473473
{
474474
free(prodesc->proname);
475475
free(prodesc);
476-
elog(ERROR, "pltcl: cache lookup from pg_proc failed");
476+
elog(ERROR, "pltcl: cache lookup for proc %u failed",
477+
proinfo->fn_oid);
477478
}
478479
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
479480

@@ -488,7 +489,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
488489
{
489490
free(prodesc->proname);
490491
free(prodesc);
491-
elog(ERROR, "pltcl: cache lookup for return type failed");
492+
elog(ERROR, "pltcl: cache lookup for return type %u failed",
493+
procStruct->prorettype);
492494
}
493495
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
494496

@@ -517,7 +519,8 @@ pltcl_func_handler(FmgrInfo *proinfo,
517519
{
518520
free(prodesc->proname);
519521
free(prodesc);
520-
elog(ERROR, "pltcl: cache lookup for argument type failed");
522+
elog(ERROR, "pltcl: cache lookup for argument type %u failed",
523+
procStruct->proargtypes[i]);
521524
}
522525
typeStruct = (Form_pg_type) GETSTRUCT(typeTup);
523526

@@ -803,7 +806,8 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
803806
{
804807
free(prodesc->proname);
805808
free(prodesc);
806-
elog(ERROR, "pltcl: cache lookup from pg_proc failed");
809+
elog(ERROR, "pltcl: cache lookup for proc %u failed",
810+
proinfo->fn_oid);
807811
}
808812
procStruct = (Form_pg_proc) GETSTRUCT(procTup);
809813

@@ -1123,9 +1127,9 @@ pltcl_trigger_handler(FmgrInfo *proinfo)
11231127
0, 0, 0);
11241128
if (!HeapTupleIsValid(typeTup))
11251129
{
1126-
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed",
1130+
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
11271131
ret_values[--i],
1128-
ObjectIdGetDatum(tupdesc->attrs[attnum - 1]->atttypid));
1132+
tupdesc->attrs[attnum - 1]->atttypid);
11291133
}
11301134
typinput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typinput);
11311135
typelem = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typelem);
@@ -2137,8 +2141,8 @@ pltcl_set_tuple_values(Tcl_Interp *interp, char *arrayname,
21372141
0, 0, 0);
21382142
if (!HeapTupleIsValid(typeTup))
21392143
{
2140-
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed",
2141-
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
2144+
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
2145+
attname, tupdesc->attrs[i]->atttypid);
21422146
}
21432147

21442148
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);
@@ -2210,8 +2214,8 @@ pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc,
22102214
0, 0, 0);
22112215
if (!HeapTupleIsValid(typeTup))
22122216
{
2213-
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %ld failed",
2214-
attname, ObjectIdGetDatum(tupdesc->attrs[i]->atttypid));
2217+
elog(ERROR, "pltcl: Cache lookup for attribute '%s' type %u failed",
2218+
attname, tupdesc->attrs[i]->atttypid);
22152219
}
22162220

22172221
typoutput = (Oid) (((Form_pg_type) GETSTRUCT(typeTup))->typoutput);

0 commit comments

Comments
 (0)