Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3153b1a5
Commit
3153b1a5
authored
Jul 29, 2016
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate a few more user-visible "cache lookup failed" errors.
Michael Paquier
parent
5676da2d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
10 deletions
+45
-10
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/ruleutils.c
+10
-10
src/test/regress/expected/rules.out
src/test/regress/expected/rules.out
+30
-0
src/test/regress/sql/rules.sql
src/test/regress/sql/rules.sql
+5
-0
No files found.
src/backend/utils/adt/ruleutils.c
View file @
3153b1a5
...
@@ -2238,11 +2238,11 @@ pg_get_function_arguments(PG_FUNCTION_ARGS)
...
@@ -2238,11 +2238,11 @@ pg_get_function_arguments(PG_FUNCTION_ARGS)
StringInfoData
buf
;
StringInfoData
buf
;
HeapTuple
proctup
;
HeapTuple
proctup
;
initStringInfo
(
&
buf
);
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
if
(
!
HeapTupleIsValid
(
proctup
))
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
);
(
void
)
print_function_arguments
(
&
buf
,
proctup
,
false
,
true
);
...
@@ -2264,11 +2264,11 @@ pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
...
@@ -2264,11 +2264,11 @@ pg_get_function_identity_arguments(PG_FUNCTION_ARGS)
StringInfoData
buf
;
StringInfoData
buf
;
HeapTuple
proctup
;
HeapTuple
proctup
;
initStringInfo
(
&
buf
);
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
if
(
!
HeapTupleIsValid
(
proctup
))
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
);
(
void
)
print_function_arguments
(
&
buf
,
proctup
,
false
,
false
);
...
@@ -2289,11 +2289,11 @@ pg_get_function_result(PG_FUNCTION_ARGS)
...
@@ -2289,11 +2289,11 @@ pg_get_function_result(PG_FUNCTION_ARGS)
StringInfoData
buf
;
StringInfoData
buf
;
HeapTuple
proctup
;
HeapTuple
proctup
;
initStringInfo
(
&
buf
);
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
if
(
!
HeapTupleIsValid
(
proctup
))
if
(
!
HeapTupleIsValid
(
proctup
))
elog
(
ERROR
,
"cache lookup failed for function %u"
,
funcid
);
PG_RETURN_NULL
();
initStringInfo
(
&
buf
);
print_function_rettype
(
&
buf
,
proctup
);
print_function_rettype
(
&
buf
,
proctup
);
...
@@ -2547,7 +2547,7 @@ pg_get_function_arg_default(PG_FUNCTION_ARGS)
...
@@ -2547,7 +2547,7 @@ pg_get_function_arg_default(PG_FUNCTION_ARGS)
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
proctup
=
SearchSysCache1
(
PROCOID
,
ObjectIdGetDatum
(
funcid
));
if
(
!
HeapTupleIsValid
(
proctup
))
if
(
!
HeapTupleIsValid
(
proctup
))
elog
(
ERROR
,
"cache lookup failed for function %u"
,
funcid
);
PG_RETURN_NULL
(
);
numargs
=
get_func_arg_info
(
proctup
,
&
argtypes
,
&
argnames
,
&
argmodes
);
numargs
=
get_func_arg_info
(
proctup
,
&
argtypes
,
&
argnames
,
&
argmodes
);
if
(
nth_arg
<
1
||
nth_arg
>
numargs
||
!
is_input_argument
(
nth_arg
-
1
,
argmodes
))
if
(
nth_arg
<
1
||
nth_arg
>
numargs
||
!
is_input_argument
(
nth_arg
-
1
,
argmodes
))
...
...
src/test/regress/expected/rules.out
View file @
3153b1a5
...
@@ -3094,3 +3094,33 @@ SELECT pg_get_viewdef(0);
...
@@ -3094,3 +3094,33 @@ SELECT pg_get_viewdef(0);
(1 row)
(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)
src/test/regress/sql/rules.sql
View file @
3153b1a5
...
@@ -1152,3 +1152,8 @@ SELECT pg_get_indexdef(0);
...
@@ -1152,3 +1152,8 @@ SELECT pg_get_indexdef(0);
SELECT
pg_get_ruledef
(
0
);
SELECT
pg_get_ruledef
(
0
);
SELECT
pg_get_triggerdef
(
0
);
SELECT
pg_get_triggerdef
(
0
);
SELECT
pg_get_viewdef
(
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
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment