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
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2001-03-22 05:01:46 +01:00
|
|
|
* $Id: syscache.h,v 1.29 2001/03/22 04:01:14 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
|
|
|
|
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
|
2000-06-17 06:56:39 +02:00
|
|
|
* they are entered into the structure cacheinfo[] in syscache.c.
|
|
|
|
* Keep them in alphabetical 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
|
1999-11-24 17:52:50 +01:00
|
|
|
#define SHADOWNAME 23
|
|
|
|
#define SHADOWSYSID 24
|
|
|
|
#define STATRELID 25
|
|
|
|
#define TYPENAME 26
|
|
|
|
#define TYPEOID 27
|
1996-08-28 03:59:28 +02:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void InitCatalogCache(void);
|
2000-11-16 23:30:52 +01:00
|
|
|
|
|
|
|
extern HeapTuple SearchSysCache(int cacheId,
|
2001-03-22 05:01:46 +01:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
2000-11-16 23:30:52 +01:00
|
|
|
extern void ReleaseSysCache(HeapTuple tuple);
|
|
|
|
|
|
|
|
/* convenience routines */
|
|
|
|
extern HeapTuple SearchSysCacheCopy(int cacheId,
|
2001-03-22 05:01:46 +01:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
2000-11-16 23:30:52 +01:00
|
|
|
extern Oid GetSysCacheOid(int cacheId,
|
2001-03-22 05:01:46 +01:00
|
|
|
Datum key1, Datum key2, Datum key3, Datum key4);
|
2000-11-16 23:30:52 +01:00
|
|
|
|
|
|
|
/* macro for just probing for existence of a tuple via the syscache */
|
|
|
|
#define SearchSysCacheExists(c,k1,k2,k3,k4) \
|
|
|
|
OidIsValid(GetSysCacheOid(c,k1,k2,k3,k4))
|
|
|
|
|
2000-01-23 04:43:24 +01:00
|
|
|
extern Datum SysCacheGetAttr(int cacheId, HeapTuple tup,
|
2000-06-17 06:56:39 +02:00
|
|
|
AttrNumber attributeNumber, bool *isNull);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* SYSCACHE_H */
|