提交 00377e02 编写于 作者: 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
上级 1ccc3df7
......@@ -2317,11 +2317,11 @@ pg_get_function_arguments(PG_FUNCTION_ARGS)
StringInfoData buf;
HeapTuple proctup;
initStringInfo(&buf);
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
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);
......@@ -2343,11 +2343,11 @@ pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
StringInfoData buf;
HeapTuple proctup;
initStringInfo(&buf);
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
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);
......@@ -2368,11 +2368,11 @@ pg_get_function_result(PG_FUNCTION_ARGS)
StringInfoData buf;
HeapTuple proctup;
initStringInfo(&buf);
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
PG_RETURN_NULL();
initStringInfo(&buf);
print_function_rettype(&buf, proctup);
......@@ -2602,7 +2602,7 @@ pg_get_function_arg_default(PG_FUNCTION_ARGS)
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(proctup))
elog(ERROR, "cache lookup failed for function %u", funcid);
PG_RETURN_NULL();
numargs = get_func_arg_info(proctup, &argtypes, &argnames, &argmodes);
if (nth_arg < 1 || nth_arg > numargs || !is_input_argument(nth_arg - 1, argmodes))
......
......@@ -2772,6 +2772,36 @@ 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)
SELECT pg_get_function_arg_default(0, 0);
pg_get_function_arg_default
-----------------------------
(1 row)
SELECT pg_get_function_arg_default('pg_class'::regclass, 0);
pg_get_function_arg_default
-----------------------------
(1 row)
-- test rule for select-for-update
create table t_test_rules_select_for_update (c int) distributed randomly;
create rule myrule as on insert to t_test_rules_select_for_update
......
......@@ -1043,6 +1043,11 @@ 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);
SELECT pg_get_function_arg_default(0, 0);
SELECT pg_get_function_arg_default('pg_class'::regclass, 0);
-- test rule for select-for-update
create table t_test_rules_select_for_update (c int) distributed randomly;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册