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/parser/parse_func.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/parser/parse_func.c')
-rw-r--r-- | src/backend/parser/parse_func.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 04089971004..df34711af6e 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.220 2010/01/02 16:57:49 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.221 2010/02/14 18:42:15 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -1108,9 +1108,8 @@ func_get_detail(List *funcname, } } - ftup = SearchSysCache(PROCOID, - ObjectIdGetDatum(best_candidate->oid), - 0, 0, 0); + ftup = SearchSysCache1(PROCOID, + ObjectIdGetDatum(best_candidate->oid)); if (!HeapTupleIsValid(ftup)) /* should not happen */ elog(ERROR, "cache lookup failed for function %u", best_candidate->oid); @@ -1563,9 +1562,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError) } /* Make sure it's an aggregate */ - ftup = SearchSysCache(PROCOID, - ObjectIdGetDatum(oid), - 0, 0, 0); + ftup = SearchSysCache1(PROCOID, ObjectIdGetDatum(oid)); if (!HeapTupleIsValid(ftup)) /* should not happen */ elog(ERROR, "cache lookup failed for function %u", oid); pform = (Form_pg_proc) GETSTRUCT(ftup); |