1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* syscache.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* System catalog cache definitions.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
1999-08-09 05:13:31 +02:00
|
|
|
* See also lsyscache.h, which provides convenience routines for
|
|
|
|
* common cache-lookup operations.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1999-11-22 18:56:41 +01:00
|
|
|
* $Id: syscache.h,v 1.21 1999/11/22 17:56:38 momjian Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef SYSCACHE_H
|
1996-08-28 03:59:28 +02:00
|
|
|
#define SYSCACHE_H
|
|
|
|
|
1999-07-16 01:04:24 +02:00
|
|
|
#include "access/htup.h"
|
1996-10-19 06:16:04 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
/* #define CACHEDEBUG *//* turns DEBUG elogs on */
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
1997-09-07 07:04:48 +02:00
|
|
|
* Declarations for util/syscache.c.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* SysCache identifiers.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* The order of these must match the order
|
|
|
|
* they are entered into the structure cacheinfo[] in syscache.c
|
1999-11-22 18:56:41 +01:00
|
|
|
* Keep them in alphabeticall order.
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
|
|
|
|
1999-11-22 18:56:41 +01:00
|
|
|
#define AGGNAME 0
|
|
|
|
#define AMNAME 1
|
|
|
|
#define AMOPOPID 2
|
|
|
|
#define AMOPSTRATEGY 3
|
|
|
|
#define ATTNAME 4
|
|
|
|
#define ATTNUM 5
|
|
|
|
#define CLADEFTYPE 6
|
|
|
|
#define CLANAME 7
|
|
|
|
#define GRONAME 8
|
|
|
|
#define GROSYSID 9
|
|
|
|
#define INDEXRELID 10
|
|
|
|
#define INHRELID 11
|
|
|
|
#define LANGNAME 12
|
|
|
|
#define LANGOID 13
|
|
|
|
#define LISTENREL 14
|
|
|
|
#define OPERNAME 15
|
|
|
|
#define OPEROID 16
|
|
|
|
#define PROCNAME 17
|
|
|
|
#define PROCOID 18
|
|
|
|
#define RELNAME 19
|
|
|
|
#define RELOID 20
|
|
|
|
#define RULENAME 21
|
|
|
|
#define RULEOID 22
|
|
|
|
#define TYPENAME 23
|
|
|
|
#define TYPEOID 24
|
|
|
|
#define USERNAME 25
|
|
|
|
#define USERSYSID 26
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* struct cachedesc: information needed for a call to InitSysCache()
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
struct cachedesc
|
|
|
|
{
|
1998-09-01 06:40:42 +02:00
|
|
|
char *name; /* this is Name so that we can initialize
|
|
|
|
* it */
|
1997-09-08 04:41:22 +02:00
|
|
|
int nkeys;
|
|
|
|
int key[4];
|
|
|
|
int size; /* sizeof(appropriate struct) */
|
|
|
|
char *indname; /* index relation for this cache, if
|
1997-09-07 07:04:48 +02:00
|
|
|
* exists */
|
1997-09-08 23:56:23 +02:00
|
|
|
HeapTuple (*iScanFunc) ();/* function to handle index scans */
|
1996-08-28 03:59:28 +02:00
|
|
|
};
|
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void zerocaches(void);
|
|
|
|
extern void InitCatalogCache(void);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern HeapTuple SearchSysCacheTupleCopy(int cacheId,
|
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
|
|
|
extern HeapTuple SearchSysCacheTuple(int cacheId,
|
1998-08-19 04:04:17 +02:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern int32 SearchSysCacheStruct(int cacheId, char *returnStruct,
|
1997-09-07 07:04:48 +02:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
1998-09-01 06:40:42 +02:00
|
|
|
extern void *SearchSysCacheGetAttribute(int cacheId,
|
1997-09-07 07:04:48 +02:00
|
|
|
AttrNumber attributeNumber,
|
1998-09-01 06:40:42 +02:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* SYSCACHE_H */
|