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
|
|
|
*
|
|
|
|
|
*
|
2008-01-01 14:46:01 -05:00
|
|
|
* Portions Copyright (c) 1996-2008, 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
|
|
|
*
|
2008-01-01 14:46:01 -05:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.61 2008/01/01 19:45:59 momjian 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
|
|
|
|
|
|
|
|
/*
|
2006-07-31 16:09:10 -04:00
|
|
|
* Routines to open (lookup) and close a relcache entry
|
1996-08-27 21:59:28 -04:00
|
|
|
*/
|
|
|
|
|
extern Relation RelationIdGetRelation(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);
|
2005-08-11 21:36:05 -04:00
|
|
|
extern Oid RelationGetOidIndex(Relation relation);
|
2003-05-28 12:04:02 -04:00
|
|
|
extern List *RelationGetIndexExpressions(Relation relation);
|
|
|
|
|
extern List *RelationGetIndexPredicate(Relation relation);
|
2007-09-20 13:56:33 -04:00
|
|
|
extern Bitmapset *RelationGetIndexAttrBitmap(Relation relation);
|
2000-06-17 17:49:04 -04:00
|
|
|
|
2005-08-11 21:36:05 -04:00
|
|
|
extern void RelationSetIndexList(Relation relation,
|
2005-10-14 22:49:52 -04:00
|
|
|
List *indexIds, Oid oidIndex);
|
2003-09-24 14:54:02 -04:00
|
|
|
|
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);
|
|
|
|
|
|
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,
|
2002-03-26 14:17:02 -05:00
|
|
|
Oid relnamespace,
|
2001-10-25 01:50:21 -04:00
|
|
|
TupleDesc tupDesc,
|
2004-06-18 02:14:31 -04:00
|
|
|
Oid relid,
|
|
|
|
|
Oid reltablespace,
|
2005-04-13 21:38:22 -04:00
|
|
|
bool shared_relation);
|
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);
|
|
|
|
|
|
2005-01-10 15:02:24 -05:00
|
|
|
extern void RelationCacheInvalidateEntry(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
|
|
|
|
2004-06-30 20:52:04 -04:00
|
|
|
extern void AtEOXact_RelationCache(bool isCommit);
|
2004-09-16 12:58:44 -04:00
|
|
|
extern void AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
|
2005-10-14 22:49:52 -04:00
|
|
|
SubTransactionId parentSubid);
|
1999-09-04 14:42:15 -04:00
|
|
|
|
2007-03-28 20:15:39 -04:00
|
|
|
extern void RelationCacheMarkNewRelfilenode(Relation rel);
|
|
|
|
|
|
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);
|
2006-11-05 18:40:31 -05:00
|
|
|
extern void RelationCacheInitFileRemove(const char *dbPath);
|
2000-11-21 16:16:06 -05: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 */
|