Commit 9cf80f2f authored by Tom Lane's avatar Tom Lane

Clean out another pocket of functions called via nonspecific function

pointers, namely the catcache tuple fetch routines.  Also get rid of
the unused and possibly confusing 'size' field in struct cachedesc.
Since it doesn't allow for variable-length fields, anyone who
actually trusted it would likely be making a mistake...
parent 1652d433
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.115 2000/06/15 03:32:02 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.116 2000/06/17 04:56:36 tgl Exp $
*
*
* INTERFACE ROUTINES
......@@ -479,13 +479,13 @@ UpdateRelationRelation(Relation indexRelation, char *temp_relname)
/* XXX Natts_pg_class_fixed is a hack - see pg_class.h */
tuple = heap_addheader(Natts_pg_class_fixed,
sizeof(*indexRelation->rd_rel),
CLASS_TUPLE_SIZE,
(char *) indexRelation->rd_rel);
/* ----------------
* the new tuple must have the same oid as the relcache entry for the
* index. sure would be embarassing to do this sort of thing in polite
* company.
* index. sure would be embarrassing to do this sort of thing in
* polite company.
* ----------------
*/
tuple->t_data->t_oid = RelationGetRelid(indexRelation);
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.65 2000/06/05 07:28:53 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.66 2000/06/17 04:56:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -29,12 +29,12 @@
#include "utils/syscache.h"
static void CatCacheRemoveCTup(CatCache *cache, Dlelem *e);
static Index CatalogCacheComputeHashIndex(struct catcache * cacheInP);
static Index CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
static Index CatalogCacheComputeHashIndex(CatCache *cacheInP);
static Index CatalogCacheComputeTupleHashIndex(CatCache *cacheInOutP,
Relation relation,
HeapTuple tuple);
static void CatalogCacheInitializeCache(struct catcache * cache,
Relation relation);
static void CatalogCacheInitializeCache(CatCache *cache,
Relation relation);
static Datum cc_hashname(PG_FUNCTION_ARGS);
/* ----------------
......@@ -168,7 +168,7 @@ do { \
#endif
static void
CatalogCacheInitializeCache(struct catcache * cache,
CatalogCacheInitializeCache(CatCache * cache,
Relation relation)
{
MemoryContext oldcxt;
......@@ -196,7 +196,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
*/
if (!RelationIsValid(relation))
{
struct catcache *cp;
CatCache *cp;
/* ----------------
* scan the caches to see if any other cache has opened the relation
......@@ -307,7 +307,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
* --------------------------------
*/
static Index
CatalogCacheComputeHashIndex(struct catcache * cacheInP)
CatalogCacheComputeHashIndex(CatCache * cacheInP)
{
uint32 hashIndex = 0;
......@@ -351,7 +351,7 @@ CatalogCacheComputeHashIndex(struct catcache * cacheInP)
* --------------------------------
*/
static Index
CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
CatalogCacheComputeTupleHashIndex(CatCache * cacheInOutP,
Relation relation,
HeapTuple tuple)
{
......@@ -543,7 +543,7 @@ void
ResetSystemCache()
{
MemoryContext oldcxt;
struct catcache *cache;
CatCache *cache;
CACHE1_elog(DEBUG, "ResetSystemCache called");
......@@ -632,7 +632,7 @@ SystemCacheRelationFlushed(Oid relId)
}
/* --------------------------------
* InitIndexedSysCache
* InitSysCache
*
* This allocates and initializes a cache for a system catalog relation.
* Actually, the cache is only partially initialized to avoid opening the
......@@ -666,7 +666,7 @@ InitSysCache(char *relname,
int id,
int nkeys,
int *key,
HeapTuple (*iScanfuncP) ())
ScanFunc iScanfuncP)
{
CatCache *cp;
int i;
......@@ -797,11 +797,11 @@ InitSysCache(char *relname,
* 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
* cache should already be initialized
* --------------------------------
*/
static HeapTuple
SearchSelfReferences(struct catcache * cache)
SearchSelfReferences(CatCache * cache)
{
HeapTuple ntp;
Relation rel;
......@@ -896,7 +896,7 @@ SearchSelfReferences(struct catcache * cache)
* --------------------------------
*/
HeapTuple
SearchSysCache(struct catcache * cache,
SearchSysCache(CatCache * cache,
Datum v1,
Datum v2,
Datum v3,
......@@ -1035,34 +1035,22 @@ SearchSysCache(struct catcache * cache,
if ((RelationGetForm(relation))->relhasindex
&& !IsIgnoringSystemIndexes())
{
HeapTuple indextp;
/* ----------
* Switch back to old memory context so memory not freed
* in the scan function will go away at transaction end.
* wieck - 10/18/1996
* ----------
*/
HeapTuple indextp;
MemoryContextSwitchTo(oldcxt);
Assert(cache->cc_iscanfunc);
switch (cache->cc_nkeys)
{
case 4:
indextp = cache->cc_iscanfunc(relation, v1, v2, v3, v4);
break;
case 3:
indextp = cache->cc_iscanfunc(relation, v1, v2, v3);
break;
case 2:
indextp = cache->cc_iscanfunc(relation, v1, v2);
break;
case 1:
indextp = cache->cc_iscanfunc(relation, v1);
break;
default:
indextp = NULL;
break;
}
/* We call the scanfunc with all four arguments to satisfy the
* declared prototype, even though the function will likely not
* use all four.
*/
indextp = cache->cc_iscanfunc(relation, v1, v2, v3, v4);
/* ----------
* Back to Cache context. If we got a tuple copy it
* into our context. wieck - 10/18/1996
......@@ -1200,7 +1188,7 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
HeapTuple tuple,
void (*function) (int, Index, ItemPointer))
{
struct catcache *ccp;
CatCache *ccp;
MemoryContext oldcxt;
Oid relationId;
......@@ -1251,6 +1239,4 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
* ----------------
*/
MemoryContextSwitchTo(oldcxt);
/* sendpm('I', "Invalidated tuple"); */
}
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.99 2000/06/02 15:57:30 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.100 2000/06/17 04:56:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -344,12 +344,13 @@ scan_pg_rel_ind(RelationBuildDescInfo buildinfo)
switch (buildinfo.infotype)
{
case INFO_RELID:
return_tuple = ClassOidIndexScan(pg_class_desc, buildinfo.i.info_id);
return_tuple = ClassOidIndexScan(pg_class_desc,
ObjectIdGetDatum(buildinfo.i.info_id));
break;
case INFO_RELNAME:
return_tuple = ClassNameIndexScan(pg_class_desc,
buildinfo.i.info_name);
PointerGetDatum(buildinfo.i.info_name));
break;
default:
......@@ -382,10 +383,17 @@ AllocateRelationDesc(Relation relation, u_int natts,
Form_pg_class relationForm;
/* ----------------
* allocate space for the relation tuple form
* Copy the relation tuple form
*
* We only allocate space for the fixed fields, ie, CLASS_TUPLE_SIZE.
* relacl is NOT stored in the relcache --- there'd be little point
* in it, since we don't copy the tuple's nullvalues bitmap and hence
* wouldn't know if the value is valid ... bottom line is that relacl
* *cannot* be retrieved from the relcache. Get it from the syscache
* if you need it.
* ----------------
*/
relationForm = (Form_pg_class) palloc(sizeof(FormData_pg_class));
relationForm = (Form_pg_class) palloc(CLASS_TUPLE_SIZE);
memcpy((char *) relationForm, (char *) relp, CLASS_TUPLE_SIZE);
......@@ -586,14 +594,16 @@ build_tupdesc_ind(RelationBuildDescInfo buildinfo,
bool columnDropped = false;
#endif /* _DROP_COLUMN_HACK__ */
atttup = (HeapTuple) AttributeRelidNumIndexScan(attrel,
RelationGetRelid(relation), i);
atttup = AttributeRelidNumIndexScan(attrel,
ObjectIdGetDatum(RelationGetRelid(relation)),
Int32GetDatum(i));
if (!HeapTupleIsValid(atttup))
{
#ifdef _DROP_COLUMN_HACK__
atttup = (HeapTuple) AttributeRelidNumIndexScan(attrel,
RelationGetRelid(relation), DROPPED_COLUMN_INDEX(i));
atttup = AttributeRelidNumIndexScan(attrel,
ObjectIdGetDatum(RelationGetRelid(relation)),
Int32GetDatum(DROPPED_COLUMN_INDEX(i)));
if (!HeapTupleIsValid(atttup))
#endif /* _DROP_COLUMN_HACK__ */
elog(ERROR, "cannot find attribute %d of relation %s", i,
......
This diff is collapsed.
......@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: indexing.h,v 1.39 2000/06/07 04:09:44 momjian Exp $
* $Id: indexing.h,v 1.40 2000/06/17 04:56:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -18,7 +18,7 @@
#include "access/htup.h"
/*
* Some definitions for indices on pg_attribute
* Number of indices that exist for each system catalog
*/
#define Num_pg_aggregate_indices 1
#define Num_pg_am_indices 1
......@@ -42,7 +42,6 @@
#define Num_pg_trigger_indices 3
#define Num_pg_type_indices 2
/*
* Names of indices on system catalogs
*/
......@@ -109,56 +108,58 @@ extern char *IndexedCatalogNames[];
/*
* indexing.c prototypes
*
* Functions for each index to perform the necessary scan on a cache miss.
*/
extern void CatalogOpenIndices(int nIndices, char **names, Relation *idescs);
extern void CatalogCloseIndices(int nIndices, Relation *idescs);
extern void CatalogIndexInsert(Relation *idescs,
int nIndices,
Relation heapRelation,
HeapTuple heapTuple);
extern void CatalogIndexInsert(Relation *idescs, int nIndices,
Relation heapRelation, HeapTuple heapTuple);
extern bool CatalogHasIndex(char *catName, Oid catId);
/*
* Functions for each index to perform the necessary scan on a cache miss.
* All index-value arguments should be passed as Datum for portability!
*/
extern HeapTuple AccessMethodOpidIndexScan(Relation heapRelation,
Oid claid, Oid opopr, Oid opid);
Datum claid, Datum opopr, Datum opid);
extern HeapTuple AccessMethodStrategyIndexScan(Relation heapRelation,
Oid opid, Oid claid, int2 opstrategy);
Datum opid, Datum claid, Datum opstrategy);
extern HeapTuple AggregateNameTypeIndexScan(Relation heapRelation,
char *aggName, Oid aggType);
extern HeapTuple AmNameIndexScan(Relation heapRelation, char *amName);
Datum aggName, Datum aggType);
extern HeapTuple AmNameIndexScan(Relation heapRelation, Datum amName);
extern HeapTuple AttributeRelidNameIndexScan(Relation heapRelation,
Oid relid, char *attname);
Datum relid, Datum attname);
extern HeapTuple AttributeRelidNumIndexScan(Relation heapRelation,
Oid relid, AttrNumber attnum);
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
extern HeapTuple GroupNameIndexScan(Relation heapRelation, char *groName);
extern HeapTuple GroupSysidIndexScan(Relation heapRelation, int4 sysId);
extern HeapTuple IndexRelidIndexScan(Relation heapRelation, Oid relid);
extern HeapTuple InheritsRelidSeqnoIndexScan(Relation heapRelation, Oid relid,
int4 seqno);
extern HeapTuple LanguageNameIndexScan(Relation heapRelation, char *lanName);
extern HeapTuple LanguageOidIndexScan(Relation heapRelation, Oid lanId);
extern HeapTuple ListenerPidRelnameIndexScan(Relation heapRelation, int4 pid, char *relName);
extern HeapTuple OpclassDeftypeIndexScan(Relation heapRelation, Oid defType);
extern HeapTuple OpclassNameIndexScan(Relation heapRelation, char *opcName);
Datum relid, Datum attnum);
extern HeapTuple ClassNameIndexScan(Relation heapRelation, Datum relName);
extern HeapTuple ClassNameIndexScan(Relation heapRelation, Datum relName);
extern HeapTuple ClassOidIndexScan(Relation heapRelation, Datum relId);
extern HeapTuple GroupNameIndexScan(Relation heapRelation, Datum groName);
extern HeapTuple GroupSysidIndexScan(Relation heapRelation, Datum sysId);
extern HeapTuple IndexRelidIndexScan(Relation heapRelation, Datum relid);
extern HeapTuple InheritsRelidSeqnoIndexScan(Relation heapRelation,
Datum relid, Datum seqno);
extern HeapTuple LanguageNameIndexScan(Relation heapRelation, Datum lanName);
extern HeapTuple LanguageOidIndexScan(Relation heapRelation, Datum lanId);
extern HeapTuple ListenerPidRelnameIndexScan(Relation heapRelation,
Datum pid, Datum relName);
extern HeapTuple OpclassDeftypeIndexScan(Relation heapRelation, Datum defType);
extern HeapTuple OpclassNameIndexScan(Relation heapRelation, Datum opcName);
extern HeapTuple OperatorNameIndexScan(Relation heapRelation,
char *oprName, Oid oprLeft, Oid oprRight, char oprKind);
extern HeapTuple OperatorOidIndexScan(Relation heapRelation, Oid oprId);
Datum oprName, Datum oprLeft,
Datum oprRight, Datum oprKind);
extern HeapTuple OperatorOidIndexScan(Relation heapRelation, Datum oprId);
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
char *procName, int2 nargs, Oid *argTypes);
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
extern HeapTuple RewriteOidIndexScan(Relation heapRelation, Oid rewriteId);
Datum procName, Datum nargs, Datum argTypes);
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Datum procId);
extern HeapTuple RewriteOidIndexScan(Relation heapRelation, Datum rewriteId);
extern HeapTuple RewriteRulenameIndexScan(Relation heapRelation,
char *ruleName);
extern HeapTuple ShadowNameIndexScan(Relation heapRelation, char *useName);
extern HeapTuple ShadowSysidIndexScan(Relation heapRelation, int4 sysId);
Datum ruleName);
extern HeapTuple ShadowNameIndexScan(Relation heapRelation, Datum useName);
extern HeapTuple ShadowSysidIndexScan(Relation heapRelation, Datum sysId);
extern HeapTuple StatisticRelidAttnumIndexScan(Relation heapRelation,
Oid relId, AttrNumber attNum);
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
Datum relId, Datum attNum);
extern HeapTuple TypeNameIndexScan(Relation heapRelation, Datum typeName);
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Datum typeId);
......
......@@ -8,21 +8,16 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.37 2000/06/12 03:40:53 momjian Exp $
* $Id: pg_class.h,v 1.38 2000/06/17 04:56:31 tgl Exp $
*
* NOTES
* ``pg_relation'' is being replaced by ``pg_class''. currently
* we are only changing the name in the catalogs but someday the
* code will be changed too. -cim 2/26/90
* [it finally happens. -ay 11/5/94]
*
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_RELATION_H
#define PG_RELATION_H
#ifndef PG_CLASS_H
#define PG_CLASS_H
/* ----------------
* postgres.h contains the system type definintions and the
......@@ -37,18 +32,16 @@
*
* Note: the #if 0, #endif around the BKI_BEGIN.. END block
* below keeps cpp from seeing what is meant for the
* genbki script: pg_relation is now called pg_class, but
* only in the catalogs -cim 2/26/90
* genbki script
* ----------------
*/
/* ----------------
* This structure is actually variable-length (the last attribute is
* a POSTGRES array). Hence, sizeof(FormData_pg_class) does not
* describe the fixed-length or actual size of the structure.
* FormData_pg_class.relacl may not be correctly aligned, either,
* if aclitem and struct varlena don't align together. Hence,
* you MUST use heap_getattr() to get the relacl field.
* necessarily match the actual length of the structure. Furthermore
* relacl may be a NULL field. Hence, you MUST use heap_getattr()
* to get the relacl field ... and don't forget to check isNull.
* ----------------
*/
CATALOG(pg_class) BOOTSTRAP
......@@ -64,24 +57,26 @@ CATALOG(pg_class) BOOTSTRAP
bool relisshared;
char relkind;
int2 relnatts;
/*
* relnatts is the number of user attributes this class has. There
* must be exactly this many instances in Class pg_attribute for this
* class which have attnum > 0 (= user attribute).
* class that have attnum > 0 (= user attribute).
*/
int2 relchecks; /* # of CHECK constraints, not stored in
* db? */
int2 relchecks; /* # of CHECK constraints for class */
int2 reltriggers; /* # of TRIGGERs */
int2 relukeys; /* # of Unique keys */
int2 relfkeys; /* # of FOREIGN KEYs */
int2 relrefs; /* # of references to this relation */
int2 relrefs; /* # of references to this rel (not used!) */
bool relhaspkey; /* has PRIMARY KEY */
bool relhasrules;
bool relhassubclass;
aclitem relacl[1]; /* this is here for the catalog */
bool relhasrules; /* has associated rules */
bool relhassubclass; /* has derived classes */
/*
* relacl may or may not be present, see note above!
*/
aclitem relacl[1]; /* we declare this just for the catalog */
} FormData_pg_class;
/* Size of fixed part of pg_class tuples, not counting relacl or padding */
#define CLASS_TUPLE_SIZE \
(offsetof(FormData_pg_class,relhassubclass) + sizeof(bool))
......@@ -123,7 +118,7 @@ typedef FormData_pg_class *Form_pg_class;
#define Anum_pg_class_relrefs 16
#define Anum_pg_class_relhaspkey 17
#define Anum_pg_class_relhasrules 18
#define Anum_pg_class_relhassubclass 19
#define Anum_pg_class_relhassubclass 19
#define Anum_pg_class_relacl 20
/* ----------------
......@@ -176,10 +171,10 @@ DESCR("");
#define RELKIND_INDEX 'i' /* secondary index */
#define RELKIND_LOBJECT 'l' /* large objects */
#define RELKIND_RELATION 'r' /* cataloged heap */
#define RELKIND_RELATION 'r' /* ordinary cataloged heap */
#define RELKIND_SPECIAL 's' /* special (non-heap) */
#define RELKIND_SEQUENCE 'S' /* SEQUENCE relation */
#define RELKIND_UNCATALOGED 'u' /* temporary heap */
#define RELKIND_LONGVALUE 'v' /* moved off huge values */
#endif /* PG_RELATION_H */
#endif /* PG_CLASS_H */
......@@ -7,18 +7,29 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: catcache.h,v 1.23 2000/06/15 03:33:10 momjian Exp $
* $Id: catcache.h,v 1.24 2000/06/17 04:56:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef CATCACHE_H
#define CATCACHE_H
/* #define CACHEDEBUG turns DEBUG elogs on */
/* #define CACHEDEBUG */ /* turns DEBUG elogs on */
#include "access/htup.h"
#include "lib/dllist.h"
/*
* Functions that implement index scans for caches must match this signature
* (except we allow unused key arguments to be omitted --- is that really
* portable?)
*/
typedef HeapTuple (*ScanFunc) (Relation heapRelation,
Datum key1,
Datum key2,
Datum key3,
Datum key4);
/*
* struct catctup: tuples in the cache.
* struct catcache: information for managing a cache.
......@@ -26,8 +37,7 @@
typedef struct catctup
{
HeapTuple ct_tup; /* A pointer to a tuple */
HeapTuple ct_tup; /* A pointer to a tuple */
/*
* Each tuple in the cache has two catctup items, one in the LRU list
* and one in the hashbucket list for its hash value. ct_node in each
......@@ -38,7 +48,7 @@ typedef struct catctup
/* voodoo constants */
#define NCCBUCK 500 /* CatCache buckets */
#define MAXTUP 300 /* Maximum # of tuples cached per cache */
#define MAXTUP 300 /* Maximum # of tuples stored per cache */
typedef struct catcache
......@@ -47,7 +57,7 @@ typedef struct catcache
Oid indexId;
char *cc_relname; /* relation name for defered open */
char *cc_indname; /* index name for defered open */
HeapTuple (*cc_iscanfunc) (); /* index scanfunction */
ScanFunc cc_iscanfunc; /* index scan function */
TupleDesc cc_tupdesc; /* tuple descriptor from reldesc */
int id; /* XXX could be improved -hirohama */
bool busy; /* for detecting recursive lookups */
......@@ -71,11 +81,14 @@ extern void CatalogCacheIdInvalidate(int cacheId, Index hashIndex,
ItemPointer pointer);
extern void ResetSystemCache(void);
extern void SystemCacheRelationFlushed(Oid relId);
extern CatCache *InitSysCache(char *relname, char *indname, int id, int nkeys,
int *key, HeapTuple (*iScanfuncP) ());
extern HeapTuple SearchSysCache(struct catcache * cache, Datum v1, Datum v2,
Datum v3, Datum v4);
extern CatCache *InitSysCache(char *relname, char *indname, int id,
int nkeys, int *key,
ScanFunc iScanfuncP);
extern HeapTuple SearchSysCache(CatCache * cache,
Datum v1, Datum v2,
Datum v3, Datum v4);
extern void RelationInvalidateCatalogCacheTuple(Relation relation,
HeapTuple tuple, void (*function) ());
HeapTuple tuple,
void (*function) (int, Index, ItemPointer));
#endif /* CATCACHE_H */
......@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: syscache.h,v 1.25 2000/04/12 17:16:55 momjian Exp $
* $Id: syscache.h,v 1.26 2000/06/17 04:56:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -18,17 +18,14 @@
#include "access/htup.h"
/* #define CACHEDEBUG *//* turns DEBUG elogs on */
/*
* Declarations for util/syscache.c.
*
* SysCache identifiers.
*
* The order of these must match the order
* they are entered into the structure cacheinfo[] in syscache.c
* Keep them in alphabeticall order.
* they are entered into the structure cacheinfo[] in syscache.c.
* Keep them in alphabetical order.
*/
#define AGGNAME 0
......@@ -60,30 +57,13 @@
#define TYPENAME 26
#define TYPEOID 27
/* ----------------
* struct cachedesc: information needed for a call to InitSysCache()
* ----------------
*/
struct cachedesc
{
char *name; /* this is Name so that we can initialize
* it */
int nkeys;
int key[4];
int size; /* sizeof(appropriate struct) */
char *indname; /* index relation for this cache, if
* exists */
HeapTuple (*iScanFunc) ();/* function to handle index scans */
};
extern void zerocaches(void);
extern void InitCatalogCache(void);
extern HeapTuple SearchSysCacheTupleCopy(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern HeapTuple SearchSysCacheTuple(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern HeapTuple SearchSysCacheTupleCopy(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);
extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
AttrNumber attributeNumber,
bool *isnull);
AttrNumber attributeNumber, bool *isNull);
#endif /* SYSCACHE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment