1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Clean up usage of some deprecated APIs, particularly schema-unsafe

usage of RelationNameGetTupleDesc().
This commit is contained in:
Tom Lane
2007-08-26 23:36:32 +00:00
parent 08fc73c4c3
commit 0effa088f5
3 changed files with 39 additions and 34 deletions

View File

@ -595,8 +595,10 @@ each(PG_FUNCTION_ARGS)
memcpy(st->hs, hs, VARSIZE(hs));
funcctx->user_fctx = (void *) st;
tupdesc = RelationNameGetTupleDesc("hs_each");
funcctx->slot = TupleDescGetSlot(tupdesc);
/* Build a tuple descriptor for our result type */
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
elog(ERROR, "return type must be a row type");
funcctx->attinmeta = TupleDescGetAttInMetadata(tupdesc);
MemoryContextSwitchTo(oldcontext);
@ -637,7 +639,7 @@ each(PG_FUNCTION_ARGS)
st->i++;
tuple = heap_formtuple(funcctx->attinmeta->tupdesc, dvalues, nulls);
res = TupleGetDatum(funcctx->slot, tuple);
res = HeapTupleGetDatum(tuple);
pfree(DatumGetPointer(dvalues[0]));
if (nulls[1] != 'n')