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/adt/xml.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/backend/utils/adt/xml.c') diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 504a35e94c4..b32d03f90f7 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.95 2010/01/02 16:57:55 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.96 2010/02/14 18:42:17 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -2612,9 +2612,7 @@ map_sql_table_to_xmlschema(TupleDesc tupdesc, Oid relid, bool nulls, HeapTuple tuple; Form_pg_class reltuple; - tuple = SearchSysCache(RELOID, - ObjectIdGetDatum(relid), - 0, 0, 0); + tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for relation %u", relid); reltuple = (Form_pg_class) GETSTRUCT(tuple); @@ -2912,9 +2910,7 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod) HeapTuple tuple; Form_pg_type typtuple; - tuple = SearchSysCache(TYPEOID, - ObjectIdGetDatum(typeoid), - 0, 0, 0); + tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typeoid)); if (!HeapTupleIsValid(tuple)) elog(ERROR, "cache lookup failed for type %u", typeoid); typtuple = (Form_pg_type) GETSTRUCT(tuple); -- cgit v1.2.3