diff options
| author | Jeff Davis | 2022-04-07 05:26:43 +0000 |
|---|---|---|
| committer | Jeff Davis | 2022-04-07 06:06:46 +0000 |
| commit | 5c279a6d350205cc98f91fb8e1d3e4442a6b25d1 (patch) | |
| tree | 4165add040730afa0e116ab5be1db5dc6fa93aea /src/include/access/rmgr.h | |
| parent | a8cfb0c1a964ebbe830c5138d389b0d2627ec298 (diff) | |
Custom WAL Resource Managers.
Allow extensions to specify a new custom resource manager (rmgr),
which allows specialized WAL. This is meant to be used by a Table
Access Method or Index Access Method.
Prior to this commit, only Generic WAL was available, which offers
support for recovery and physical replication but not logical
replication.
Reviewed-by: Julien Rouhaud, Bharath Rupireddy, Andres Freund
Discussion: https://postgr.es/m/ed1fb2e22d15d3563ae0eb610f7b61bb15999c0a.camel%40j-davis.com
Diffstat (limited to 'src/include/access/rmgr.h')
| -rw-r--r-- | src/include/access/rmgr.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/include/access/rmgr.h b/src/include/access/rmgr.h index d9b512630ca..d9a96410d97 100644 --- a/src/include/access/rmgr.h +++ b/src/include/access/rmgr.h @@ -30,6 +30,23 @@ typedef enum RmgrIds #undef PG_RMGR -#define RM_MAX_ID (RM_NEXT_ID - 1) +#define RM_MAX_ID UINT8_MAX +#define RM_MAX_BUILTIN_ID (RM_NEXT_ID - 1) +#define RM_MIN_CUSTOM_ID 128 +#define RM_MAX_CUSTOM_ID UINT8_MAX +#define RM_N_IDS (UINT8_MAX + 1) +#define RM_N_BUILTIN_IDS (RM_MAX_BUILTIN_ID + 1) +#define RM_N_CUSTOM_IDS (RM_MAX_CUSTOM_ID - RM_MIN_CUSTOM_ID + 1) +#define RMID_IS_BUILTIN(rmid) ((rmid) <= RM_MAX_BUILTIN_ID) +#define RMID_IS_CUSTOM(rmid) ((rmid) >= RM_MIN_CUSTOM_ID && \ + (rmid) <= RM_MAX_CUSTOM_ID) +#define RMID_IS_VALID(rmid) (RMID_IS_BUILTIN((rmid)) || RMID_IS_CUSTOM((rmid))) + +/* + * RmgrId to use for extensions that require an RmgrId, but are still in + * development and have not reserved their own unique RmgrId yet. See: + * https://wiki.postgresql.org/wiki/CustomWALResourceManagers + */ +#define RM_EXPERIMENTAL_ID 128 #endif /* RMGR_H */ |
