Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*-------------------------------------------------------------------------
 *
 * inval.h
 *    POSTGRES cache invalidation dispatcher definitions.
 *
 *
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/utils/inval.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef INVAL_H
#define INVAL_H
 
#include "access/htup.h"
#include "catalog/syscache_ids.h"
#include "storage/relfilelocator.h"
#include "utils/relcache.h"
 
extern PGDLLIMPORT int debug_discard_caches;
 
#define MIN_DEBUG_DISCARD_CACHES 0
 
#ifdef DISCARD_CACHES_ENABLED
 /* Set default based on older compile-time-only cache clobber macros */
#if defined(CLOBBER_CACHE_RECURSIVELY)
#define DEFAULT_DEBUG_DISCARD_CACHES 3
#elif defined(CLOBBER_CACHE_ALWAYS)
#define DEFAULT_DEBUG_DISCARD_CACHES 1
#else
#define DEFAULT_DEBUG_DISCARD_CACHES 0
#endif
#define MAX_DEBUG_DISCARD_CACHES 5
#else                           /* not DISCARD_CACHES_ENABLED */
#define DEFAULT_DEBUG_DISCARD_CACHES 0
#define MAX_DEBUG_DISCARD_CACHES 0
#endif                          /* not DISCARD_CACHES_ENABLED */
 
 
typedef void (*SyscacheCallbackFunction) (Datum arg, SysCacheIdentifier cacheid,
                                          uint32 hashvalue);
typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid);
 
 
extern void AcceptInvalidationMessages(void);
/* [PG_CUSTOM: TEMP_CATALOG] BEGIN: Операция temp-объекта идёт через локальный memory catalog. */
extern void temp_invalidation_begin_local_scope(void);
extern void temp_invalidation_end_local_scope(void);
extern bool temp_invalidation_local_scope_active(void);
/* [PG_CUSTOM: TEMP_CATALOG] END */
 
extern void AtEOXact_Inval(bool isCommit);
 
extern void PreInplace_Inval(void);
extern void AtInplace_Inval(void);
extern void ForgetInplace_Inval(void);
 
extern void AtEOSubXact_Inval(bool isCommit);
 
extern void PostPrepare_Inval(void);
 
extern void CommandEndInvalidationMessages(void);
 
extern void CacheInvalidateHeapTuple(Relation relation,
                                     HeapTuple tuple,
                                     HeapTuple newtuple);
extern void CacheInvalidateHeapTupleInplace(Relation relation,
                                            HeapTuple key_equivalent_tuple);
 
extern void CacheInvalidateCatalog(Oid catalogId);
 
extern void CacheInvalidateRelcache(Relation relation);
 
extern void CacheInvalidateRelcacheAll(void);
 
extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple);
 
extern void CacheInvalidateRelcacheByRelid(Oid relid);
 
extern void CacheInvalidateRelSync(Oid relid);
 
extern void CacheInvalidateRelSyncAll(void);
 
extern void CacheInvalidateSmgr(RelFileLocatorBackend rlocator);
 
extern void CacheInvalidateRelmap(Oid databaseId);
 
extern void CacheRegisterSyscacheCallback(SysCacheIdentifier cacheid,
                                          SyscacheCallbackFunction func,
                                          Datum arg);
 
extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
                                          Datum arg);
 
extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
                                         Datum arg);
 
extern void CallSyscacheCallbacks(SysCacheIdentifier cacheid, uint32 hashvalue);
 
extern void CallRelSyncCallbacks(Oid relid);
 
extern void InvalidateSystemCaches(void);
extern void InvalidateSystemCachesExtended(bool debug_discard);
 
extern void LogLogicalInvalidations(void);
#endif                          /* INVAL_H */