mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.107 2010/01/02 16:57:49 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.108 2010/02/14 18:42:15 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -208,9 +208,7 @@ transformArrayType(Oid arrayType)
|
||||
Form_pg_type type_struct_array;
|
||||
|
||||
/* Get the type tuple for the array */
|
||||
type_tuple_array = SearchSysCache(TYPEOID,
|
||||
ObjectIdGetDatum(arrayType),
|
||||
0, 0, 0);
|
||||
type_tuple_array = SearchSysCache1(TYPEOID, ObjectIdGetDatum(arrayType));
|
||||
if (!HeapTupleIsValid(type_tuple_array))
|
||||
elog(ERROR, "cache lookup failed for type %u", arrayType);
|
||||
type_struct_array = (Form_pg_type) GETSTRUCT(type_tuple_array);
|
||||
|
Reference in New Issue
Block a user