1996-08-27 21:59:28 -04:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
1999-02-13 18:22:53 -05:00
|
|
|
* relcache.h
|
1997-09-07 01:04:48 -04:00
|
|
|
* Relation descriptor cache definitions.
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
|
|
|
|
*
|
2001-01-24 14:43:33 -05:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 00:58:53 -05:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
2002-02-19 15:11:20 -05:00
|
|
|
* $Id: relcache.h,v 1.30 2002/02/19 20:11:20 tgl Exp $
|
1996-08-27 21:59:28 -04:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
1997-09-07 01:04:48 -04:00
|
|
|
#ifndef RELCACHE_H
|
1996-08-27 21:59:28 -04:00
|
|
|
#define RELCACHE_H
|
|
|
|
|
|
1999-07-15 19:04:24 -04:00
|
|
|
#include "utils/rel.h"
|
1996-08-27 21:59:28 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* relation lookup routines
|
|
|
|
|
*/
|
|
|
|
|
extern Relation RelationIdGetRelation(Oid relationId);
|
2000-01-22 09:20:56 -05:00
|
|
|
extern Relation RelationNameGetRelation(const char *relationName);
|
2000-10-23 00:10:24 -04:00
|
|
|
extern Relation RelationNodeCacheGetRelation(RelFileNode rnode);
|
1996-08-27 21:59:28 -04:00
|
|
|
|
2000-06-17 17:49:04 -04:00
|
|
|
/* finds an existing cache entry, but won't make a new one */
|
|
|
|
|
extern Relation RelationIdCacheGetRelation(Oid relationId);
|
|
|
|
|
|
1997-09-07 22:41:22 -04:00
|
|
|
extern void RelationClose(Relation relation);
|
1999-10-03 19:55:40 -04:00
|
|
|
|
2000-06-17 17:49:04 -04:00
|
|
|
/*
|
|
|
|
|
* Routines to compute/retrieve additional cached information
|
|
|
|
|
*/
|
|
|
|
|
extern List *RelationGetIndexList(Relation relation);
|
|
|
|
|
|
2001-10-06 19:21:45 -04:00
|
|
|
extern void RelationInitIndexAccessInfo(Relation relation);
|
|
|
|
|
|
2000-08-06 00:40:08 -04:00
|
|
|
/*
|
|
|
|
|
* Routines for backend startup
|
|
|
|
|
*/
|
|
|
|
|
extern void RelationCacheInitialize(void);
|
|
|
|
|
extern void RelationCacheInitializePhase2(void);
|
2002-02-19 15:11:20 -05:00
|
|
|
extern void RelationCacheInitializePhase3(void);
|
2000-08-06 00:40:08 -04:00
|
|
|
|
2001-06-29 17:08:25 -04:00
|
|
|
/*
|
|
|
|
|
* Routine to create a relcache entry for an about-to-be-created relation
|
|
|
|
|
*/
|
|
|
|
|
extern Relation RelationBuildLocalRelation(const char *relname,
|
2001-10-25 01:50:21 -04:00
|
|
|
TupleDesc tupDesc,
|
|
|
|
|
Oid relid, Oid dbid,
|
|
|
|
|
bool nailit);
|
2001-06-29 17:08:25 -04:00
|
|
|
|
1999-10-03 19:55:40 -04:00
|
|
|
/*
|
|
|
|
|
* Routines for flushing/rebuilding relcache entries in various scenarios
|
|
|
|
|
*/
|
2001-06-29 17:08:25 -04:00
|
|
|
extern void RelationForgetRelation(Oid rid);
|
|
|
|
|
|
1997-09-07 22:41:22 -04:00
|
|
|
extern void RelationIdInvalidateRelationCacheByRelationId(Oid relationId);
|
1996-08-27 21:59:28 -04:00
|
|
|
|
2000-01-30 23:35:57 -05:00
|
|
|
extern void RelationCacheInvalidate(void);
|
1996-08-27 21:59:28 -04:00
|
|
|
|
1997-09-07 22:41:22 -04:00
|
|
|
extern void RelationPurgeLocalRelation(bool xactComitted);
|
1996-08-27 21:59:28 -04:00
|
|
|
|
1999-09-04 14:42:15 -04:00
|
|
|
extern void RelationCacheAbort(void);
|
|
|
|
|
|
2002-02-19 15:11:20 -05:00
|
|
|
/*
|
|
|
|
|
* Routines to help manage rebuilding of relcache init file
|
|
|
|
|
*/
|
|
|
|
|
extern bool RelationIdIsInInitFile(Oid relationId);
|
|
|
|
|
extern void RelationCacheInitFileInvalidate(bool beforeSend);
|
2000-11-21 16:16:06 -05:00
|
|
|
|
2001-10-06 19:21:45 -04:00
|
|
|
/* XLOG support */
|
2000-11-21 16:16:06 -05:00
|
|
|
extern void CreateDummyCaches(void);
|
|
|
|
|
extern void DestroyDummyCaches(void);
|
|
|
|
|
|
1999-05-01 15:09:46 -04:00
|
|
|
|
2002-02-19 15:11:20 -05:00
|
|
|
/* should be used only by relcache.c and catcache.c */
|
|
|
|
|
extern bool criticalRelcachesBuilt;
|
2001-10-28 01:26:15 -05:00
|
|
|
|
2001-11-05 12:46:40 -05:00
|
|
|
#endif /* RELCACHE_H */
|