1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* relcache.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* Relation descriptor cache definitions.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*
|
2009-01-01 18:24:05 +01:00
|
|
|
* Portions Copyright (c) 1996-2009, 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
|
|
|
*
|
2009-12-07 06:22:23 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/relcache.h,v 1.65 2009/12/07 05:22:23 tgl Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef RELCACHE_H
|
1996-08-28 03:59:28 +02:00
|
|
|
#define RELCACHE_H
|
|
|
|
|
2008-06-19 02:46:06 +02:00
|
|
|
#include "access/tupdesc.h"
|
|
|
|
#include "nodes/bitmapset.h"
|
|
|
|
#include "nodes/pg_list.h"
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct RelationData *Relation;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* RelationPtr is used in the executor to support index scans
|
|
|
|
* where we have to keep track of several index relations in an
|
|
|
|
* array. -cim 9/10/89
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
typedef Relation *RelationPtr;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
2006-07-31 22:09:10 +02:00
|
|
|
* Routines to open (lookup) and close a relcache entry
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
|
|
|
extern Relation RelationIdGetRelation(Oid relationId);
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void RelationClose(Relation relation);
|
1999-10-04 01:55:40 +02:00
|
|
|
|
2000-06-17 23:49:04 +02:00
|
|
|
/*
|
|
|
|
* Routines to compute/retrieve additional cached information
|
|
|
|
*/
|
|
|
|
extern List *RelationGetIndexList(Relation relation);
|
2005-08-12 03:36:05 +02:00
|
|
|
extern Oid RelationGetOidIndex(Relation relation);
|
2003-05-28 18:04:02 +02:00
|
|
|
extern List *RelationGetIndexExpressions(Relation relation);
|
|
|
|
extern List *RelationGetIndexPredicate(Relation relation);
|
2007-09-20 19:56:33 +02:00
|
|
|
extern Bitmapset *RelationGetIndexAttrBitmap(Relation relation);
|
2009-12-07 06:22:23 +01:00
|
|
|
extern void RelationGetExclusionInfo(Relation indexRelation,
|
|
|
|
Oid **operators,
|
|
|
|
Oid **procs,
|
|
|
|
uint16 **strategies);
|
2000-06-17 23:49:04 +02:00
|
|
|
|
2005-08-12 03:36:05 +02:00
|
|
|
extern void RelationSetIndexList(Relation relation,
|
2005-10-15 04:49:52 +02:00
|
|
|
List *indexIds, Oid oidIndex);
|
2003-09-24 20:54:02 +02:00
|
|
|
|
2001-10-07 01:21:45 +02:00
|
|
|
extern void RelationInitIndexAccessInfo(Relation relation);
|
|
|
|
|
2000-08-06 06:40:08 +02:00
|
|
|
/*
|
|
|
|
* Routines for backend startup
|
|
|
|
*/
|
|
|
|
extern void RelationCacheInitialize(void);
|
|
|
|
extern void RelationCacheInitializePhase2(void);
|
2009-08-12 22:53:31 +02:00
|
|
|
extern void RelationCacheInitializePhase3(void);
|
2000-08-06 06:40:08 +02:00
|
|
|
|
2001-06-29 23:08:25 +02:00
|
|
|
/*
|
|
|
|
* Routine to create a relcache entry for an about-to-be-created relation
|
|
|
|
*/
|
|
|
|
extern Relation RelationBuildLocalRelation(const char *relname,
|
2002-03-26 20:17:02 +01:00
|
|
|
Oid relnamespace,
|
2001-10-25 07:50:21 +02:00
|
|
|
TupleDesc tupDesc,
|
2004-06-18 08:14:31 +02:00
|
|
|
Oid relid,
|
|
|
|
Oid reltablespace,
|
2005-04-14 03:38:22 +02:00
|
|
|
bool shared_relation);
|
2001-06-29 23:08:25 +02:00
|
|
|
|
1999-10-04 01:55:40 +02:00
|
|
|
/*
|
|
|
|
* Routines for flushing/rebuilding relcache entries in various scenarios
|
|
|
|
*/
|
2001-06-29 23:08:25 +02:00
|
|
|
extern void RelationForgetRelation(Oid rid);
|
|
|
|
|
2005-01-10 21:02:24 +01:00
|
|
|
extern void RelationCacheInvalidateEntry(Oid relationId);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-01-31 05:35:57 +01:00
|
|
|
extern void RelationCacheInvalidate(void);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2004-07-01 02:52:04 +02:00
|
|
|
extern void AtEOXact_RelationCache(bool isCommit);
|
2004-09-16 18:58:44 +02:00
|
|
|
extern void AtEOSubXact_RelationCache(bool isCommit, SubTransactionId mySubid,
|
2005-10-15 04:49:52 +02:00
|
|
|
SubTransactionId parentSubid);
|
1999-09-04 20:42:15 +02:00
|
|
|
|
2007-03-29 02:15:39 +02:00
|
|
|
extern void RelationCacheMarkNewRelfilenode(Relation rel);
|
|
|
|
|
2002-02-19 21:11:20 +01:00
|
|
|
/*
|
2009-08-12 22:53:31 +02:00
|
|
|
* Routines to help manage rebuilding of relcache init files
|
2002-02-19 21:11:20 +01:00
|
|
|
*/
|
|
|
|
extern bool RelationIdIsInInitFile(Oid relationId);
|
|
|
|
extern void RelationCacheInitFileInvalidate(bool beforeSend);
|
2009-08-12 22:53:31 +02:00
|
|
|
extern void RelationCacheInitFileRemove(void);
|
2000-11-21 22:16:06 +01:00
|
|
|
|
2002-02-19 21:11:20 +01:00
|
|
|
/* should be used only by relcache.c and catcache.c */
|
|
|
|
extern bool criticalRelcachesBuilt;
|
2009-08-12 22:53:31 +02:00
|
|
|
/* should be used only by relcache.c and postinit.c */
|
|
|
|
extern bool criticalSharedRelcachesBuilt;
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* RELCACHE_H */
|