diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-02-14 18:42:19 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-02-14 18:42:19 +0000 |
commit | e26c539e9f326ea843c0ed005af093b56b55cd4d (patch) | |
tree | 4f3830d394229b747cbceeab3cdbbfccccec74d1 /src/backend/utils/mb/mbutils.c | |
parent | 1012492bc0bfb322d59db17e17735d17d634e264 (diff) |
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.
Diffstat (limited to 'src/backend/utils/mb/mbutils.c')
-rw-r--r-- | src/backend/utils/mb/mbutils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index c8a43dced6f..9064c85fc6e 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -4,7 +4,7 @@ * * Tatsuo Ishii * - * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.92 2009/11/12 02:46:16 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.93 2010/02/14 18:42:18 rhaas Exp $ */ #include "postgres.h" @@ -319,9 +319,7 @@ pg_do_encoding_conversion(unsigned char *src, int len, * are going into infinite loop! So we have to make sure that the * function exists before calling OidFunctionCall. */ - if (!SearchSysCacheExists(PROCOID, - ObjectIdGetDatum(proc), - 0, 0, 0)) + if (!SearchSysCacheExists1(PROCOID, ObjectIdGetDatum(proc))) { elog(LOG, "cache lookup failed for function %u", proc); return src; |