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/commands/variable.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/backend/commands/variable.c') diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c index fc115012f51..835b548235e 100644 --- a/src/backend/commands/variable.c +++ b/src/backend/commands/variable.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.132 2010/01/02 16:57:40 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.133 2010/02/14 18:42:14 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -727,9 +727,7 @@ assign_session_authorization(const char *value, bool doit, GucSource source) return NULL; } - roleTup = SearchSysCache(AUTHNAME, - PointerGetDatum(value), - 0, 0, 0); + roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(value)); if (!HeapTupleIsValid(roleTup)) { ereport(GUC_complaint_elevel(source), @@ -839,9 +837,7 @@ assign_role(const char *value, bool doit, GucSource source) return NULL; } - roleTup = SearchSysCache(AUTHNAME, - PointerGetDatum(value), - 0, 0, 0); + roleTup = SearchSysCache1(AUTHNAME, PointerGetDatum(value)); if (!HeapTupleIsValid(roleTup)) { ereport(GUC_complaint_elevel(source), -- cgit v1.2.3