提交 0506026f 编写于 作者: R Robert Haas 提交者: Jimmy Yih

Eliminate a few more user-visible "cache lookup failed" errors.

Michael Paquier

Original Postgres commit:
https://github.com/postgres/postgres/commit/3153b1a52f8f2d1efe67306257aec15aaaf9e94c
上级 b82d0a50
......@@ -1540,13 +1540,13 @@ pg_get_function_arguments(PG_FUNCTION_ARGS)
StringInfoData buf;
HeapTuple proctup;
initStringInfo(&buf);
proctup = SearchSysCache(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
PG_RETURN_NULL();
initStringInfo(&buf);
(void) print_function_arguments(&buf, proctup, false, true);
......@@ -1568,13 +1568,13 @@ pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
StringInfoData buf;
HeapTuple proctup;
initStringInfo(&buf);
proctup = SearchSysCache(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
PG_RETURN_NULL();
initStringInfo(&buf);
(void) print_function_arguments(&buf, proctup, false, false);
......@@ -1598,17 +1598,17 @@ pg_get_function_result(PG_FUNCTION_ARGS)
Form_pg_proc procform;
int ntabargs = 0;
initStringInfo(&buf);
initStringInfo(&argbuf);
proctup = SearchSysCache(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
PG_RETURN_NULL();
procform = (Form_pg_proc) GETSTRUCT(proctup);
initStringInfo(&buf);
initStringInfo(&argbuf);
ntabargs = print_function_arguments(&argbuf, proctup, true, true);
/* We have 3 cases: table function, setof function and others */
......
......@@ -1603,3 +1603,21 @@ SELECT pg_get_viewdef(0);
(1 row)
SELECT pg_get_function_arguments(0);
pg_get_function_arguments
---------------------------
(1 row)
SELECT pg_get_function_identity_arguments(0);
pg_get_function_identity_arguments
------------------------------------
(1 row)
SELECT pg_get_function_result(0);
pg_get_function_result
------------------------
(1 row)
......@@ -941,3 +941,6 @@ SELECT pg_get_indexdef(0);
SELECT pg_get_ruledef(0);
SELECT pg_get_triggerdef(0);
SELECT pg_get_viewdef(0);
SELECT pg_get_function_arguments(0);
SELECT pg_get_function_identity_arguments(0);
SELECT pg_get_function_result(0);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册