aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/catcache.c119
-rw-r--r--src/backend/utils/cache/fcache.c10
-rw-r--r--src/backend/utils/cache/lsyscache.c34
-rw-r--r--src/backend/utils/cache/relcache.c6
-rw-r--r--src/backend/utils/cache/syscache.c329
5 files changed, 282 insertions, 216 deletions
diff --git a/src/backend/utils/cache/catcache.c b/src/backend/utils/cache/catcache.c
index e5a1684041c..96e8288916a 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.53 1999/11/21 01:58:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.54 1999/11/22 17:56:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,6 +15,7 @@
#include "access/genam.h"
#include "access/heapam.h"
#include "access/valid.h"
+#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "catalog/catname.h"
#include "catalog/indexing.h"
@@ -711,7 +712,6 @@ InitSysCache(char *relname,
* ----------------
*/
{
-
/*
* We can only do this optimization because the number of hash
* buckets never changes. Without it, we call malloc() too much.
@@ -811,9 +811,10 @@ InitSysCache(char *relname,
/* --------------------------------
* SearchSelfReferences
*
- * This call searches a self referencing information,
- *
- * which causes a cycle in system catalog cache
+ * This call searches for self-referencing information,
+ * which causes infinite recursion in the system catalog cache.
+ * This code short-circuits the normal index lookup for cache loads
+ * in those cases and replaces it with a heap scan.
*
* cache should already be initailized
* --------------------------------
@@ -823,45 +824,81 @@ SearchSelfReferences(struct catcache * cache)
{
HeapTuple ntp;
Relation rel;
- static Oid indexSelfOid = 0;
- static HeapTuple indexSelfTuple = 0;
-
- if (cache->id != INDEXRELID)
- return (HeapTuple)0;
- if (!indexSelfOid)
+ if (cache->id == INDEXRELID)
{
- rel = heap_openr(RelationRelationName, AccessShareLock);
- ntp = ClassNameIndexScan(rel, IndexRelidIndex);
- if (!HeapTupleIsValid(ntp))
- elog(ERROR, "SearchSelfRefernces: %s not found in %s",
- IndexRelidIndex, RelationRelationName);
- indexSelfOid = ntp->t_data->t_oid;
- pfree(ntp);
- heap_close(rel, AccessShareLock);
+ static Oid indexSelfOid = InvalidOid;
+ static HeapTuple indexSelfTuple = NULL;
+
+ if (!OidIsValid(indexSelfOid))
+ {
+ /* Find oid of pg_index_indexrelid_index */
+ rel = heap_openr(RelationRelationName, AccessShareLock);
+ ntp = ClassNameIndexScan(rel, IndexRelidIndex);
+ if (!HeapTupleIsValid(ntp))
+ elog(ERROR, "SearchSelfReferences: %s not found in %s",
+ IndexRelidIndex, RelationRelationName);
+ indexSelfOid = ntp->t_data->t_oid;
+ pfree(ntp);
+ heap_close(rel, AccessShareLock);
+ }
+ /* Looking for something other than pg_index_indexrelid_index? */
+ if ((Oid)cache->cc_skey[0].sk_argument != indexSelfOid)
+ return (HeapTuple)0;
+
+ /* Do we need to load our private copy of the tuple? */
+ if (!HeapTupleIsValid(indexSelfTuple))
+ {
+ HeapScanDesc sd;
+ MemoryContext oldcxt;
+
+ if (!CacheCxt)
+ CacheCxt = CreateGlobalMemory("Cache");
+ rel = heap_open(cache->relationId, AccessShareLock);
+ sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
+ ntp = heap_getnext(sd, 0);
+ if (!HeapTupleIsValid(ntp))
+ elog(ERROR, "SearchSelfReferences: tuple not found");
+ oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ indexSelfTuple = heap_copytuple(ntp);
+ MemoryContextSwitchTo(oldcxt);
+ heap_endscan(sd);
+ heap_close(rel, AccessShareLock);
+ }
+ return indexSelfTuple;
}
- if ((Oid)cache->cc_skey[0].sk_argument != indexSelfOid)
- return (HeapTuple)0;
- if (!indexSelfTuple)
+ else if (cache->id == OPEROID)
{
- HeapScanDesc sd;
- MemoryContext oldcxt;
-
- if (!CacheCxt)
- CacheCxt = CreateGlobalMemory("Cache");
- rel = heap_open(cache->relationId, AccessShareLock);
- sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
- ntp = heap_getnext(sd, 0);
- if (!HeapTupleIsValid(ntp))
- elog(ERROR, "SearchSelfRefernces: tuple not found");
- oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
- indexSelfTuple = heap_copytuple(ntp);
- MemoryContextSwitchTo(oldcxt);
- heap_endscan(sd);
- heap_close(rel, AccessShareLock);
+ /* bootstrapping this requires preloading a range of rows. bjm */
+ static HeapTuple operatorSelfTuple[MAX_OIDCMP-MIN_OIDCMP+1];
+ Oid lookup_oid = (Oid)cache->cc_skey[0].sk_argument;
+
+ if (lookup_oid < MIN_OIDCMP || lookup_oid > MAX_OIDCMP)
+ return (HeapTuple)0;
+
+ if (!HeapTupleIsValid(operatorSelfTuple[lookup_oid-MIN_OIDCMP]))
+ {
+ HeapScanDesc sd;
+ MemoryContext oldcxt;
+
+ if (!CacheCxt)
+ CacheCxt = CreateGlobalMemory("Cache");
+ rel = heap_open(cache->relationId, AccessShareLock);
+ sd = heap_beginscan(rel, false, SnapshotNow, 1, cache->cc_skey);
+ ntp = heap_getnext(sd, 0);
+ if (!HeapTupleIsValid(ntp))
+ elog(ERROR, "SearchSelfReferences: tuple not found");
+ oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ operatorSelfTuple[lookup_oid-MIN_OIDCMP] = heap_copytuple(ntp);
+ MemoryContextSwitchTo(oldcxt);
+ heap_endscan(sd);
+ heap_close(rel, AccessShareLock);
+ }
+ return operatorSelfTuple[lookup_oid-MIN_OIDCMP];
}
+ else
+ return (HeapTuple)0;
- return indexSelfTuple;
}
/* --------------------------------
@@ -907,10 +944,8 @@ SearchSysCache(struct catcache * cache,
/*
* resolve self referencing informtion
*/
- if (ntp = SearchSelfReferences(cache), ntp)
- {
- return heap_copytuple(ntp);
- }
+ if ((ntp = SearchSelfReferences(cache)))
+ return heap_copytuple(ntp);
/* ----------------
* find the hash bucket in which to look for the tuple
diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c
index 33ba637b13c..69ef78af096 100644
--- a/src/backend/utils/cache/fcache.c
+++ b/src/backend/utils/cache/fcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.26 1999/07/17 20:18:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.27 1999/11/22 17:56:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,7 +53,7 @@ GetDynamicFuncArgType(Var *arg, ExprContext *econtext)
relname = (char *) getrelname(rtid, econtext->ecxt_range_table);
- tup = SearchSysCacheTuple(TYPNAME,
+ tup = SearchSysCacheTuple(TYPENAME,
PointerGetDatum(relname),
0, 0, 0);
if (!tup)
@@ -89,7 +89,7 @@ init_fcache(Oid foid,
if (!use_syscache)
elog(ERROR, "what the ????, init the fcache without the catalogs?");
- procedureTuple = SearchSysCacheTuple(PROOID,
+ procedureTuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(foid),
0, 0, 0);
@@ -110,7 +110,7 @@ init_fcache(Oid foid,
* to "null" so we just return it.
* ----------------
*/
- typeTuple = SearchSysCacheTuple(TYPOID,
+ typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(procedureStruct->prorettype),
0, 0, 0);
@@ -255,7 +255,7 @@ init_fcache(Oid foid,
else
{
tmp = (text *)
- SearchSysCacheGetAttribute(PROOID,
+ SearchSysCacheGetAttribute(PROCOID,
Anum_pg_proc_probin,
ObjectIdGetDatum(foid),
0, 0, 0);
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index d2b097ed2f5..ab9f74c0ae1 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.35 1999/11/07 23:08:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.36 1999/11/22 17:56:32 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -263,7 +263,7 @@ get_opcode(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -286,7 +286,7 @@ get_opname(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -310,7 +310,7 @@ op_mergejoinable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -342,7 +342,7 @@ op_hashjoinable(Oid opno, Oid ltype, Oid rtype)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -362,7 +362,7 @@ get_operator_tuple(Oid opno)
{
HeapTuple optup;
- if ((optup = SearchSysCacheTuple(OPROID,
+ if ((optup = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0)))
return optup;
@@ -381,7 +381,7 @@ get_commutator(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -404,7 +404,7 @@ get_negator(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -427,7 +427,7 @@ get_oprrest(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -450,7 +450,7 @@ get_oprjoin(Oid opno)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(OPROID,
+ tp = SearchSysCacheTuple(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -474,7 +474,7 @@ get_func_rettype(Oid funcid)
HeapTuple func_tuple;
Oid funcrettype;
- func_tuple = SearchSysCacheTuple(PROOID,
+ func_tuple = SearchSysCacheTuple(PROCOID,
ObjectIdGetDatum(funcid),
0, 0, 0);
@@ -548,7 +548,7 @@ get_typlen(Oid typid)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(TYPOID,
+ tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -572,7 +572,7 @@ get_typbyval(Oid typid)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(TYPOID,
+ tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -590,7 +590,7 @@ get_typalign(Oid typid)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(TYPOID,
+ tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
@@ -628,7 +628,7 @@ get_typdefault(Oid typid)
* First, see if there is a non-null typdefault field (usually there isn't)
*/
typDefault = (struct varlena *)
- SearchSysCacheGetAttribute(TYPOID,
+ SearchSysCacheGetAttribute(TYPEOID,
Anum_pg_type_typdefault,
ObjectIdGetDatum(typid),
0, 0, 0);
@@ -645,7 +645,7 @@ get_typdefault(Oid typid)
* just did --- but at present this path isn't taken often enough to
* make it worth fixing.
*/
- typeTuple = SearchSysCacheTuple(TYPOID,
+ typeTuple = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
@@ -727,7 +727,7 @@ get_typtype(Oid typid)
{
HeapTuple tp;
- tp = SearchSysCacheTuple(TYPOID,
+ tp = SearchSysCacheTuple(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index b6684744119..c2f5a7d655c 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.80 1999/11/21 01:58:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.81 1999/11/22 17:56:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -524,7 +524,7 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo,
for (i = 1; i <= relation->rd_rel->relnatts; i++)
{
- atttup = (HeapTuple) AttributeNumIndexScan(attrel,
+ atttup = (HeapTuple) AttributeRelidNumIndexScan(attrel,
RelationGetRelid(relation), i);
if (!HeapTupleIsValid(atttup))
@@ -2085,7 +2085,7 @@ write_irels(void)
SetProcessingMode(BootstrapProcessing);
bi.infotype = INFO_RELNAME;
- bi.i.info_name = AttributeNumIndex;
+ bi.i.info_name = AttributeRelidNumIndex;
irel[0] = RelationBuildDesc(bi, NULL);
irel[0]->rd_isnailed = true;
diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c
index aa532d99bd3..e851c40d286 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.40 1999/11/18 13:56:29 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.41 1999/11/22 17:56:32 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -45,12 +45,63 @@ extern bool AMI_OVERRIDE; /* XXX style */
typedef HeapTuple (*ScanFunc) ();
-/* ----------------
- * Warning: cacheinfo[] below is changed, then be sure and
- * update the magic constants in syscache.h!
- * ----------------
- */
+
+/*---------------------------------------------------------------------------
+
+ Adding system caches:
+
+ Add your new cache to the list in include/utils/syscache.h. Keep
+ the list sorted alphabetically and adjust the cache numbers
+ accordingly.
+
+ Add your entry to the cacheinfo[] array below. All cache lists are
+ alphabetical, so add it in the proper place. Specify the relation
+ name, number of arguments, argument names, size of tuple, index lookup
+ function, and index name.
+
+ In include/catalog/indexing.h, add a define for the number of indexes
+ in the relation, add a define for the index name, add an extern
+ array to hold the index names, define the index lookup function
+ prototype, and use DECLARE_UNIQUE_INDEX to define the index. Cache
+ lookups return only one row, so the index should be unique.
+
+ In backend/catalog/indexing.c, initialize the relation array with
+ the index names for the relation, and create the index lookup function.
+ Pick one that takes similar arguments and use that one, but keep the
+ function names in the same order as the cache list for clarity.
+
+ Finally, any place your relation gets heap_insert() or
+ heap_replace calls, include code to do a CatalogIndexInsert() to update
+ the system indexes. The heap_* calls do not update indexes.
+
+ bjm 1999/11/22
+
+ ---------------------------------------------------------------------------
+*/
+
static struct cachedesc cacheinfo[] = {
+ {AggregateRelationName, /* AGGNAME */
+ 2,
+ {
+ Anum_pg_aggregate_aggname,
+ Anum_pg_aggregate_aggbasetype,
+ 0,
+ 0
+ },
+ offsetof(FormData_pg_aggregate, agginitval1),
+ AggregateNameTypeIndex,
+ AggregateNameTypeIndexScan},
+ {AccessMethodRelationName, /* AMNAME */
+ 1,
+ {
+ Anum_pg_am_amname,
+ 0,
+ 0,
+ 0
+ },
+ sizeof(FormData_pg_am),
+ AmNameIndex,
+ AmNameIndexScan},
{AccessMethodOperatorRelationName, /* AMOPOPID */
3,
{
@@ -61,7 +112,7 @@ static struct cachedesc cacheinfo[] = {
},
sizeof(FormData_pg_amop),
AccessMethodOpidIndex,
- (ScanFunc) AccessMethodOpidIndexScan},
+ AccessMethodOpidIndexScan},
{AccessMethodOperatorRelationName, /* AMOPSTRATEGY */
3,
{
@@ -82,8 +133,8 @@ static struct cachedesc cacheinfo[] = {
0
},
ATTRIBUTE_TUPLE_SIZE,
- AttributeNameIndex,
- (ScanFunc) AttributeNameIndexScan},
+ AttributeRelidNameIndex,
+ AttributeRelidNameIndexScan},
{AttributeRelationName, /* ATTNUM */
2,
{
@@ -93,8 +144,52 @@ static struct cachedesc cacheinfo[] = {
0
},
ATTRIBUTE_TUPLE_SIZE,
- AttributeNumIndex,
- (ScanFunc) AttributeNumIndexScan},
+ AttributeRelidNumIndex,
+ (ScanFunc) AttributeRelidNumIndexScan},
+ {OperatorClassRelationName, /* CLADEFTYPE */
+ 1,
+ {
+ Anum_pg_opclass_opcdeftype,
+ 0,
+ 0,
+ 0
+ },
+ sizeof(FormData_pg_opclass),
+ OpclassDeftypeIndex,
+ OpclassDeftypeIndexScan},
+ {OperatorClassRelationName, /* CLANAME */
+ 1,
+ {
+ Anum_pg_opclass_opcname,
+ 0,
+ 0,
+ 0
+ },
+ sizeof(FormData_pg_opclass),
+ OpclassNameIndex,
+ OpclassNameIndexScan},
+ {GroupRelationName, /* GRONAME */
+ 1,
+ {
+ Anum_pg_group_groname,
+ 0,
+ 0,
+ 0
+ },
+ offsetof(FormData_pg_group, grolist[0]),
+ GroupNameIndex,
+ GroupNameIndexScan},
+ {GroupRelationName, /* GROSYSID */
+ 1,
+ {
+ Anum_pg_group_grosysid,
+ 0,
+ 0,
+ 0
+ },
+ offsetof(FormData_pg_group, grolist[0]),
+ GroupSysidIndex,
+ GroupSysidIndexScan},
{IndexRelationName, /* INDEXRELID */
1,
{
@@ -105,8 +200,19 @@ static struct cachedesc cacheinfo[] = {
},
offsetof(FormData_pg_index, indpred),
IndexRelidIndex,
- (ScanFunc) IndexRelidIndexScan},
- {LanguageRelationName, /* LANNAME */
+ IndexRelidIndexScan},
+ {InheritsRelationName, /* INHRELID */
+ 2,
+ {
+ Anum_pg_inherits_inhrelid,
+ Anum_pg_inherits_inhseqno,
+ 0,
+ 0
+ },
+ sizeof(FormData_pg_inherits),
+ InheritsRelidSeqnoIndex,
+ InheritsRelidSeqnoIndexScan},
+ {LanguageRelationName, /* LANGNAME */
1,
{
Anum_pg_language_lanname,
@@ -115,9 +221,31 @@ static struct cachedesc cacheinfo[] = {
0
},
offsetof(FormData_pg_language, lancompiler),
- NULL,
- NULL},
- {OperatorRelationName, /* OPRNAME */
+ LanguageNameIndex,
+ LanguageNameIndexScan},
+ {LanguageRelationName, /* LANGOID */
+ 1,
+ {
+ ObjectIdAttributeNumber,
+ 0,
+ 0,
+ 0
+ },
+ offsetof(FormData_pg_language, lancompiler),
+ LanguageOidIndex,
+ LanguageOidIndexScan},
+ {ListenerRelationName, /* LISTENREL */
+ 2,
+ {
+ Anum_pg_listener_relname,
+ Anum_pg_listener_pid,
+ 0,
+ 0
+ },
+ sizeof(FormData_pg_listener),
+ ListenerRelnamePidIndex,
+ ListenerRelnamePidIndexScan},
+ {OperatorRelationName, /* OPERNAME */
4,
{
Anum_pg_operator_oprname,
@@ -126,9 +254,9 @@ static struct cachedesc cacheinfo[] = {
Anum_pg_operator_oprkind
},
sizeof(FormData_pg_operator),
- NULL,
- NULL},
- {OperatorRelationName, /* OPROID */
+ OperatorNameIndex,
+ (ScanFunc) OperatorNameIndexScan},
+ {OperatorRelationName, /* OPEROID */
1,
{
ObjectIdAttributeNumber,
@@ -137,9 +265,9 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_operator),
- NULL,
- (ScanFunc) NULL},
- {ProcedureRelationName, /* PRONAME */
+ OperatorOidIndex,
+ OperatorOidIndexScan},
+ {ProcedureRelationName, /* PROCNAME */
3,
{
Anum_pg_proc_proname,
@@ -150,7 +278,7 @@ static struct cachedesc cacheinfo[] = {
offsetof(FormData_pg_proc, prosrc),
ProcedureNameIndex,
(ScanFunc) ProcedureNameIndexScan},
- {ProcedureRelationName, /* PROOID */
+ {ProcedureRelationName, /* PROCOID */
1,
{
ObjectIdAttributeNumber,
@@ -160,7 +288,7 @@ static struct cachedesc cacheinfo[] = {
},
offsetof(FormData_pg_proc, prosrc),
ProcedureOidIndex,
- (ScanFunc) ProcedureOidIndexScan},
+ ProcedureOidIndexScan},
{RelationRelationName, /* RELNAME */
1,
{
@@ -171,7 +299,7 @@ static struct cachedesc cacheinfo[] = {
},
CLASS_TUPLE_SIZE,
ClassNameIndex,
- (ScanFunc) ClassNameIndexScan},
+ ClassNameIndexScan},
{RelationRelationName, /* RELOID */
1,
{
@@ -182,19 +310,19 @@ static struct cachedesc cacheinfo[] = {
},
CLASS_TUPLE_SIZE,
ClassOidIndex,
- (ScanFunc) ClassOidIndexScan},
- {TypeRelationName, /* TYPNAME */
+ ClassOidIndexScan},
+ {RewriteRelationName, /* REWRITENAME */
1,
{
- Anum_pg_type_typname,
+ Anum_pg_rewrite_rulename,
0,
0,
0
},
- offsetof(FormData_pg_type, typalign) +sizeof(char),
- TypeNameIndex,
- TypeNameIndexScan},
- {TypeRelationName, /* TYPOID */
+ offsetof(FormData_pg_rewrite, ev_qual),
+ RewriteRulenameIndex,
+ RewriteRulenameIndexScan},
+ {RewriteRelationName, /* RULEOID */
1,
{
ObjectIdAttributeNumber,
@@ -202,43 +330,21 @@ static struct cachedesc cacheinfo[] = {
0,
0
},
- offsetof(FormData_pg_type, typalign) +sizeof(char),
- TypeOidIndex,
- TypeOidIndexScan},
- {AccessMethodRelationName, /* AMNAME */
- 1,
- {
- Anum_pg_am_amname,
- 0,
- 0,
- 0
- },
- sizeof(FormData_pg_am),
- NULL,
- NULL},
- {OperatorClassRelationName, /* CLANAME */
+ offsetof(FormData_pg_rewrite, ev_qual),
+ RewriteOidIndex,
+ RewriteOidIndexScan},
+ {TypeRelationName, /* TYPENAME */
1,
{
- Anum_pg_opclass_opcname,
- 0,
+ Anum_pg_type_typname,
0,
- 0
- },
- sizeof(FormData_pg_opclass),
- NULL,
- NULL},
- {InheritsRelationName, /* INHRELID */
- 2,
- {
- Anum_pg_inherits_inhrel,
- Anum_pg_inherits_inhseqno,
0,
0
},
- sizeof(FormData_pg_inherits),
- NULL,
- (ScanFunc) NULL},
- {RewriteRelationName, /* RULOID */
+ offsetof(FormData_pg_type, typalign) +sizeof(char),
+ TypeNameIndex,
+ TypeNameIndexScan},
+ {TypeRelationName, /* TYPEOID */
1,
{
ObjectIdAttributeNumber,
@@ -246,32 +352,10 @@ static struct cachedesc cacheinfo[] = {
0,
0
},
- offsetof(FormData_pg_rewrite, ev_qual),
- NULL,
- (ScanFunc) NULL},
- {AggregateRelationName, /* AGGNAME */
- 2,
- {
- Anum_pg_aggregate_aggname,
- Anum_pg_aggregate_aggbasetype,
- 0,
- 0
- },
- offsetof(FormData_pg_aggregate, agginitval1),
- NULL,
- (ScanFunc) NULL},
- {ListenerRelationName, /* LISTENREL */
- 2,
- {
- Anum_pg_listener_relname,
- Anum_pg_listener_pid,
- 0,
- 0
- },
- sizeof(FormData_pg_listener),
- NULL,
- (ScanFunc) NULL},
- {ShadowRelationName, /* USENAME */
+ offsetof(FormData_pg_type, typalign) +sizeof(char),
+ TypeOidIndex,
+ TypeOidIndexScan},
+ {ShadowRelationName, /* USERNAME */
1,
{
Anum_pg_shadow_usename,
@@ -280,9 +364,10 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_shadow),
- NULL,
- (ScanFunc) NULL},
- {ShadowRelationName, /* USESYSID */
+NULL,NULL
+/* ShadowNameIndex,
+ ShadowNameIndexScan*/},
+ {ShadowRelationName, /* USERSYSID */
1,
{
Anum_pg_shadow_usesysid,
@@ -291,63 +376,9 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_shadow),
- NULL,
- (ScanFunc) NULL},
- {GroupRelationName, /* GRONAME */
- 1,
- {
- Anum_pg_group_groname,
- 0,
- 0,
- 0
- },
- offsetof(FormData_pg_group, grolist[0]),
- NULL,
- (ScanFunc) NULL},
- {GroupRelationName, /* GROSYSID */
- 1,
- {
- Anum_pg_group_grosysid,
- 0,
- 0,
- 0
- },
- offsetof(FormData_pg_group, grolist[0]),
- NULL,
- (ScanFunc) NULL},
- {RewriteRelationName, /* REWRITENAME */
- 1,
- {
- Anum_pg_rewrite_rulename,
- 0,
- 0,
- 0
- },
- offsetof(FormData_pg_rewrite, ev_qual),
- NULL,
- (ScanFunc) NULL},
- {OperatorClassRelationName, /* CLADEFTYPE */
- 1,
- {
- Anum_pg_opclass_opcdeftype,
- 0,
- 0,
- 0
- },
- sizeof(FormData_pg_opclass),
- NULL,
- (ScanFunc) NULL},
- {LanguageRelationName, /* LANOID */
- 1,
- {
- ObjectIdAttributeNumber,
- 0,
- 0,
- 0
- },
- offsetof(FormData_pg_language, lancompiler),
- NULL,
- NULL}
+NULL,NULL
+/* ShadowSysidIndex,
+ ShadowSysidIndexScan*/}
};
static struct catcache *SysCache[lengthof(cacheinfo)];