mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +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:
@ -6,7 +6,7 @@
|
||||
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.87 2010/01/02 16:57:35 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.88 2010/02/14 18:42:12 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -402,9 +402,7 @@ ForceTransactionIdLimitUpdate(void)
|
||||
if (TransactionIdFollowsOrEquals(nextXid, xidVacLimit) &&
|
||||
TransactionIdIsValid(xidVacLimit))
|
||||
return true; /* past VacLimit, don't delay updating */
|
||||
if (!SearchSysCacheExists(DATABASEOID,
|
||||
ObjectIdGetDatum(oldestXidDB),
|
||||
0, 0, 0))
|
||||
if (!SearchSysCacheExists1(DATABASEOID, ObjectIdGetDatum(oldestXidDB)))
|
||||
return true; /* could happen, per comments above */
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user