From e26c539e9f326ea843c0ed005af093b56b55cd4d Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Sun, 14 Feb 2010 18:42:19 +0000 Subject: 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. --- src/backend/utils/cache/syscache.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/cache/syscache.c') diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index c04db4f02f9..0224cfb2641 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.125 2010/02/08 05:53:55 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/syscache.c,v 1.126 2010/02/14 18:42:17 rhaas Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -909,10 +909,9 @@ SearchSysCacheAttName(Oid relid, const char *attname) { HeapTuple tuple; - tuple = SearchSysCache(ATTNAME, - ObjectIdGetDatum(relid), - CStringGetDatum(attname), - 0, 0); + tuple = SearchSysCache2(ATTNAME, + ObjectIdGetDatum(relid), + CStringGetDatum(attname)); if (!HeapTupleIsValid(tuple)) return NULL; if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped) -- cgit v1.2.3