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/nodeWindowAgg.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/nodeWindowAgg.c')
-rw-r--r-- | src/backend/executor/nodeWindowAgg.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index c2c0af3cde2..2668d83b03e 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -27,7 +27,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.10 2010/02/12 17:33:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.11 2010/02/14 18:42:14 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -1726,9 +1726,7 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, inputTypes[i++] = exprType((Node *) lfirst(lc)); } - aggTuple = SearchSysCache(AGGFNOID, - ObjectIdGetDatum(wfunc->winfnoid), - 0, 0, 0); + aggTuple = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(wfunc->winfnoid)); if (!HeapTupleIsValid(aggTuple)) elog(ERROR, "cache lookup failed for aggregate %u", wfunc->winfnoid); @@ -1747,9 +1745,8 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, HeapTuple procTuple; Oid aggOwner; - procTuple = SearchSysCache(PROCOID, - ObjectIdGetDatum(wfunc->winfnoid), - 0, 0, 0); + procTuple = SearchSysCache1(PROCOID, + ObjectIdGetDatum(wfunc->winfnoid)); if (!HeapTupleIsValid(procTuple)) elog(ERROR, "cache lookup failed for function %u", wfunc->winfnoid); |