summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/lsyscache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r--src/backend/utils/cache/lsyscache.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index fba0ee8b847..e88c45d268a 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -1605,41 +1605,28 @@ get_func_leakproof(Oid funcid)
}
/*
- * get_func_cost
- * Given procedure id, return the function's procost field.
- */
-float4
-get_func_cost(Oid funcid)
-{
- HeapTuple tp;
- float4 result;
-
- tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
- if (!HeapTupleIsValid(tp))
- elog(ERROR, "cache lookup failed for function %u", funcid);
-
- result = ((Form_pg_proc) GETSTRUCT(tp))->procost;
- ReleaseSysCache(tp);
- return result;
-}
-
-/*
- * get_func_rows
- * Given procedure id, return the function's prorows field.
+ * get_func_support
+ *
+ * Returns the support function OID associated with a given function,
+ * or InvalidOid if there is none.
*/
-float4
-get_func_rows(Oid funcid)
+RegProcedure
+get_func_support(Oid funcid)
{
HeapTuple tp;
- float4 result;
tp = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
- if (!HeapTupleIsValid(tp))
- elog(ERROR, "cache lookup failed for function %u", funcid);
+ if (HeapTupleIsValid(tp))
+ {
+ Form_pg_proc functup = (Form_pg_proc) GETSTRUCT(tp);
+ RegProcedure result;
- result = ((Form_pg_proc) GETSTRUCT(tp))->prorows;
- ReleaseSysCache(tp);
- return result;
+ result = functup->prosupport;
+ ReleaseSysCache(tp);
+ return result;
+ }
+ else
+ return (RegProcedure) InvalidOid;
}
/* ---------- RELATION CACHE ---------- */