diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-02-14 18:42:19 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-02-14 18:42:19 +0000 |
commit | e26c539e9f326ea843c0ed005af093b56b55cd4d (patch) | |
tree | 4f3830d394229b747cbceeab3cdbbfccccec74d1 /src/backend/executor/functions.c | |
parent | 1012492bc0bfb322d59db17e17735d17d634e264 (diff) | |
download | postgresql-e26c539e9f326ea843c0ed005af093b56b55cd4d.tar.gz postgresql-e26c539e9f326ea843c0ed005af093b56b55cd4d.zip |
Wrap calls to SearchSysCache and related functions using macros.
The purpose of this change is to eliminate the need for every caller
of SearchSysCache, SearchSysCacheCopy, SearchSysCacheExists,
GetSysCacheOid, and SearchSysCacheList to know the maximum number
of allowable keys for a syscache entry (currently 4). This will
make it far easier to increase the maximum number of keys in a
future release should we choose to do so, and it makes the code
shorter, too.
Design and review by Tom Lane.
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r-- | src/backend/executor/functions.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c index 831f38882f7..88b47316e24 100644 --- a/src/backend/executor/functions.c +++ b/src/backend/executor/functions.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.140 2010/01/02 16:57:41 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.141 2010/02/14 18:42:14 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -232,9 +232,7 @@ init_sql_fcache(FmgrInfo *finfo, bool lazyEvalOK) /* * get the procedure tuple corresponding to the given function Oid */ - procedureTuple = SearchSysCache(PROCOID, - ObjectIdGetDatum(foid), - 0, 0, 0); + procedureTuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(foid)); if (!HeapTupleIsValid(procedureTuple)) elog(ERROR, "cache lookup failed for function %u", foid); procedureStruct = (Form_pg_proc) GETSTRUCT(procedureTuple); @@ -885,9 +883,7 @@ sql_exec_error_callback(void *arg) int syntaxerrposition; /* Need access to function's pg_proc tuple */ - func_tuple = SearchSysCache(PROCOID, - ObjectIdGetDatum(flinfo->fn_oid), - 0, 0, 0); + func_tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(flinfo->fn_oid)); if (!HeapTupleIsValid(func_tuple)) return; /* shouldn't happen */ functup = (Form_pg_proc) GETSTRUCT(func_tuple); |