mirror of
https://github.com/postgres/postgres.git
synced 2025-10-10 00:03:27 -04:00
Store the information in guc_tables.c in a .dat file similar to the catalog data in src/include/catalog/, and generate a part of guc_tables.c from that. The goal is to make it easier to edit that information, and to be able to make changes to the downstream data structures more easily. (Essentially, those are the same reasons as for the original adoption of the .dat format.) Reviewed-by: John Naylor <johncnaylorls@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: David E. Wheeler <david@justatheory.com> Discussion: https://www.postgresql.org/message-id/flat/dae6fe89-1e0c-4c3f-8d92-19d23374fb10%40eisentraut.org
104 lines
2.9 KiB
C
104 lines
2.9 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* inval.h
|
|
* POSTGRES cache invalidation dispatcher definitions.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2025, 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 "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, int cacheid, uint32 hashvalue);
|
|
typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
|
|
typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid);
|
|
|
|
|
|
extern void AcceptInvalidationMessages(void);
|
|
|
|
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 tuple,
|
|
HeapTuple newtuple);
|
|
|
|
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(int cacheid,
|
|
SyscacheCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CallSyscacheCallbacks(int 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 */
|