1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-24 01:29:19 +03:00

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
This commit is contained in:
Jeff Davis
2022-04-06 22:26:43 -07:00
parent a8cfb0c1a9
commit 5c279a6d35
24 changed files with 526 additions and 70 deletions

View File

@@ -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 */