]> granicus.if.org Git - postgresql/blob - src/include/utils/inval.h
Improve the plan cache invalidation mechanism to make it invalidate plans
[postgresql] / src / include / utils / inval.h
1 /*-------------------------------------------------------------------------
2  *
3  * inval.h
4  *        POSTGRES cache invalidation dispatcher definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/include/utils/inval.h,v 1.44 2008/09/09 18:58:09 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef INVAL_H
15 #define INVAL_H
16
17 #include "access/htup.h"
18 #include "utils/relcache.h"
19
20
21 typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, ItemPointer tuplePtr);
22 typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
23
24
25 extern void AcceptInvalidationMessages(void);
26
27 extern void AtStart_Inval(void);
28
29 extern void AtSubStart_Inval(void);
30
31 extern void AtEOXact_Inval(bool isCommit);
32
33 extern void AtEOSubXact_Inval(bool isCommit);
34
35 extern void AtPrepare_Inval(void);
36
37 extern void PostPrepare_Inval(void);
38
39 extern void CommandEndInvalidationMessages(void);
40
41 extern void BeginNonTransactionalInvalidation(void);
42
43 extern void EndNonTransactionalInvalidation(void);
44
45 extern void CacheInvalidateHeapTuple(Relation relation, HeapTuple tuple);
46
47 extern void CacheInvalidateRelcache(Relation relation);
48
49 extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple);
50
51 extern void CacheInvalidateRelcacheByRelid(Oid relid);
52
53 extern void CacheRegisterSyscacheCallback(int cacheid,
54                                                           SyscacheCallbackFunction func,
55                                                           Datum arg);
56
57 extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
58                                                           Datum arg);
59
60 extern void inval_twophase_postcommit(TransactionId xid, uint16 info,
61                                                   void *recdata, uint32 len);
62
63 #endif   /* INVAL_H */