mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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.
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.173 2010/02/12 17:33:19 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.174 2010/02/14 18:42:14 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1597,9 +1597,8 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
||||
}
|
||||
peraggstate->numArguments = numArguments;
|
||||
|
||||
aggTuple = SearchSysCache(AGGFNOID,
|
||||
ObjectIdGetDatum(aggref->aggfnoid),
|
||||
0, 0, 0);
|
||||
aggTuple = SearchSysCache1(AGGFNOID,
|
||||
ObjectIdGetDatum(aggref->aggfnoid));
|
||||
if (!HeapTupleIsValid(aggTuple))
|
||||
elog(ERROR, "cache lookup failed for aggregate %u",
|
||||
aggref->aggfnoid);
|
||||
@ -1620,9 +1619,8 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
|
||||
HeapTuple procTuple;
|
||||
Oid aggOwner;
|
||||
|
||||
procTuple = SearchSysCache(PROCOID,
|
||||
ObjectIdGetDatum(aggref->aggfnoid),
|
||||
0, 0, 0);
|
||||
procTuple = SearchSysCache1(PROCOID,
|
||||
ObjectIdGetDatum(aggref->aggfnoid));
|
||||
if (!HeapTupleIsValid(procTuple))
|
||||
elog(ERROR, "cache lookup failed for function %u",
|
||||
aggref->aggfnoid);
|
||||
|
Reference in New Issue
Block a user