Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3153b1a

Browse files
committed
Eliminate a few more user-visible "cache lookup failed" errors.
Michael Paquier
1 parent5676da2 commit3153b1a

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

‎src/backend/utils/adt/ruleutils.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,11 +2238,11 @@ pg_get_function_arguments(PG_FUNCTION_ARGS)
22382238
StringInfoDatabuf;
22392239
HeapTupleproctup;
22402240

2241-
initStringInfo(&buf);
2242-
22432241
proctup=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcid));
22442242
if (!HeapTupleIsValid(proctup))
2245-
elog(ERROR,"cache lookup failed for function %u",funcid);
2243+
PG_RETURN_NULL();
2244+
2245+
initStringInfo(&buf);
22462246

22472247
(void)print_function_arguments(&buf,proctup, false, true);
22482248

@@ -2264,11 +2264,11 @@ pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
22642264
StringInfoDatabuf;
22652265
HeapTupleproctup;
22662266

2267-
initStringInfo(&buf);
2268-
22692267
proctup=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcid));
22702268
if (!HeapTupleIsValid(proctup))
2271-
elog(ERROR,"cache lookup failed for function %u",funcid);
2269+
PG_RETURN_NULL();
2270+
2271+
initStringInfo(&buf);
22722272

22732273
(void)print_function_arguments(&buf,proctup, false, false);
22742274

@@ -2289,11 +2289,11 @@ pg_get_function_result(PG_FUNCTION_ARGS)
22892289
StringInfoDatabuf;
22902290
HeapTupleproctup;
22912291

2292-
initStringInfo(&buf);
2293-
22942292
proctup=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcid));
22952293
if (!HeapTupleIsValid(proctup))
2296-
elog(ERROR,"cache lookup failed for function %u",funcid);
2294+
PG_RETURN_NULL();
2295+
2296+
initStringInfo(&buf);
22972297

22982298
print_function_rettype(&buf,proctup);
22992299

@@ -2547,7 +2547,7 @@ pg_get_function_arg_default(PG_FUNCTION_ARGS)
25472547

25482548
proctup=SearchSysCache1(PROCOID,ObjectIdGetDatum(funcid));
25492549
if (!HeapTupleIsValid(proctup))
2550-
elog(ERROR,"cache lookup failed for function %u",funcid);
2550+
PG_RETURN_NULL();
25512551

25522552
numargs=get_func_arg_info(proctup,&argtypes,&argnames,&argmodes);
25532553
if (nth_arg<1||nth_arg>numargs|| !is_input_argument(nth_arg-1,argmodes))

‎src/test/regress/expected/rules.out

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,3 +3094,33 @@ SELECT pg_get_viewdef(0);
30943094

30953095
(1 row)
30963096

3097+
SELECT pg_get_function_arguments(0);
3098+
pg_get_function_arguments
3099+
---------------------------
3100+
3101+
(1 row)
3102+
3103+
SELECT pg_get_function_identity_arguments(0);
3104+
pg_get_function_identity_arguments
3105+
------------------------------------
3106+
3107+
(1 row)
3108+
3109+
SELECT pg_get_function_result(0);
3110+
pg_get_function_result
3111+
------------------------
3112+
3113+
(1 row)
3114+
3115+
SELECT pg_get_function_arg_default(0, 0);
3116+
pg_get_function_arg_default
3117+
-----------------------------
3118+
3119+
(1 row)
3120+
3121+
SELECT pg_get_function_arg_default('pg_class'::regclass, 0);
3122+
pg_get_function_arg_default
3123+
-----------------------------
3124+
3125+
(1 row)
3126+

‎src/test/regress/sql/rules.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,3 +1152,8 @@ SELECT pg_get_indexdef(0);
11521152
SELECT pg_get_ruledef(0);
11531153
SELECT pg_get_triggerdef(0);
11541154
SELECT pg_get_viewdef(0);
1155+
SELECT pg_get_function_arguments(0);
1156+
SELECT pg_get_function_identity_arguments(0);
1157+
SELECT pg_get_function_result(0);
1158+
SELECT pg_get_function_arg_default(0,0);
1159+
SELECT pg_get_function_arg_default('pg_class'::regclass,0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp