#include "pg_query_proctup_attrs.h"
Datum
SysCacheGetAttr(int cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
{
ProcTupWithAttrs *w;
if (cacheId != PROCOID)
elog(ERROR, "Not implemented (SysCacheGetAttr only supports PROCOID, got cache %d)", cacheId);
if (attributeNumber < 1 || attributeNumber > Natts_pg_proc)
elog(ERROR, "SysCacheGetAttr: invalid pg_proc attribute number %d", attributeNumber);
w = (ProcTupWithAttrs *) ((char *) tup - offsetof(ProcTupWithAttrs, tup));
*isNull = w->nulls[attributeNumber - 1];
return w->values[attributeNumber - 1];
}