1 /*-------------------------------------------------------------------------
2  *
3  * inval.h
4  *	  POSTGRES cache invalidation dispatcher definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/inval.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef INVAL_H
15 #define INVAL_H
16 
17 #include "access/htup.h"
18 #include "storage/relfilenode.h"
19 #include "utils/relcache.h"
20 
21 extern PGDLLIMPORT int debug_discard_caches;
22 
23 typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue);
24 typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
25 
26 
27 extern void AcceptInvalidationMessages(void);
28 
29 extern void AtEOXact_Inval(bool isCommit);
30 
31 extern void AtEOSubXact_Inval(bool isCommit);
32 
33 extern void PostPrepare_Inval(void);
34 
35 extern void CommandEndInvalidationMessages(void);
36 
37 extern void CacheInvalidateHeapTuple(Relation relation,
38 									 HeapTuple tuple,
39 									 HeapTuple newtuple);
40 
41 extern void CacheInvalidateCatalog(Oid catalogId);
42 
43 extern void CacheInvalidateRelcache(Relation relation);
44 
45 extern void CacheInvalidateRelcacheAll(void);
46 
47 extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple);
48 
49 extern void CacheInvalidateRelcacheByRelid(Oid relid);
50 
51 extern void CacheInvalidateSmgr(RelFileNodeBackend rnode);
52 
53 extern void CacheInvalidateRelmap(Oid databaseId);
54 
55 extern void CacheRegisterSyscacheCallback(int cacheid,
56 										  SyscacheCallbackFunction func,
57 										  Datum arg);
58 
59 extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
60 										  Datum arg);
61 
62 extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue);
63 
64 extern void InvalidateSystemCaches(void);
65 extern void InvalidateSystemCachesExtended(bool debug_discard);
66 
67 extern void LogLogicalInvalidations(void);
68 #endif							/* INVAL_H */
69