1999-09-27 17:48:12 +02:00
|
|
|
/*
|
|
|
|
* rmgr.h
|
|
|
|
*
|
2000-10-21 17:43:36 +02:00
|
|
|
* Resource managers definition
|
1999-09-27 17:48:12 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/access/rmgr.h
|
1999-09-27 17:48:12 +02:00
|
|
|
*/
|
|
|
|
#ifndef RMGR_H
|
|
|
|
#define RMGR_H
|
|
|
|
|
|
|
|
typedef uint8 RmgrId;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Built-in resource managers
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
*
|
2013-02-05 21:21:29 +01:00
|
|
|
* The actual numerical values for each rmgr ID are defined by the order
|
|
|
|
* of entries in rmgrlist.h.
|
|
|
|
*
|
|
|
|
* Note: RM_MAX_ID must fit in RmgrId; widening that type will affect the XLOG
|
|
|
|
* file format.
|
1999-09-27 17:48:12 +02:00
|
|
|
*/
|
2022-01-19 23:58:04 +01:00
|
|
|
#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask,decode) \
|
2013-02-05 21:21:29 +01:00
|
|
|
symname,
|
|
|
|
|
|
|
|
typedef enum RmgrIds
|
|
|
|
{
|
|
|
|
#include "access/rmgrlist.h"
|
|
|
|
RM_NEXT_ID
|
|
|
|
} RmgrIds;
|
|
|
|
|
|
|
|
#undef PG_RMGR
|
2011-12-17 22:41:16 +01:00
|
|
|
|
2022-04-07 07:26:43 +02:00
|
|
|
#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)
|
2022-04-07 09:27:07 +02:00
|
|
|
|
|
|
|
static inline bool
|
|
|
|
RmgrIdIsBuiltin(int rmid)
|
|
|
|
{
|
|
|
|
return rmid <= RM_MAX_BUILTIN_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool
|
|
|
|
RmgrIdIsCustom(int rmid)
|
|
|
|
{
|
|
|
|
return rmid >= RM_MIN_CUSTOM_ID && rmid <= RM_MAX_CUSTOM_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RmgrIdIsValid(rmid) (RmgrIdIsBuiltin((rmid)) || RmgrIdIsCustom((rmid)))
|
2022-04-07 07:26:43 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
2001-10-28 07:26:15 +01:00
|
|
|
|
1999-09-27 17:48:12 +02:00
|
|
|
#endif /* RMGR_H */
|