17 #include "utils/fmgrprotos.h"
47 #define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask,decode) \
48 { name, redo, desc, identify, startup, cleanup, mask, decode },
60 for (
int rmid = 0; rmid <=
RM_MAX_ID; rmid++)
76 for (
int rmid = 0; rmid <=
RM_MAX_ID; rmid++)
94 errhint(
"Include the extension module that implements this resource manager in \"shared_preload_libraries\".")));
111 errhint(
"Provide a non-empty name for the custom resource manager.")));
115 errhint(
"Provide a custom resource manager ID between %d and %d.",
120 (
errmsg(
"failed to register custom resource manager \"%s\" with ID %d", rmgr->
rm_name, rmid),
121 errdetail(
"Custom resource manager must be registered while initializing modules in \"shared_preload_libraries\".")));
125 (
errmsg(
"failed to register custom resource manager \"%s\" with ID %d", rmgr->
rm_name, rmid),
126 errdetail(
"Custom resource manager \"%s\" already registered with the same ID.",
130 for (
int existing_rmid = 0; existing_rmid <=
RM_MAX_ID; existing_rmid++)
137 (
errmsg(
"failed to register custom resource manager \"%s\" with ID %d", rmgr->
rm_name, rmid),
138 errdetail(
"Existing resource manager with ID %d has the same name.", existing_rmid)));
144 (
errmsg(
"registered custom resource manager \"%s\" with ID %d",
152 #define PG_GET_RESOURCE_MANAGERS_COLS 3
159 for (
int rmid = 0; rmid <=
RM_MAX_ID; rmid++)
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
bool process_shared_preload_libraries_in_progress
int pg_strcasecmp(const char *s1, const char *s2)
static Datum BoolGetDatum(bool X)
static Datum Int32GetDatum(int32 X)
RmgrData RmgrTable[RM_MAX_ID+1]
#define PG_GET_RESOURCE_MANAGERS_COLS
void RmgrNotFound(RmgrId rmid)
Datum pg_get_wal_resource_managers(PG_FUNCTION_ARGS)
void RegisterCustomRmgr(RmgrId rmid, const RmgrData *rmgr)
static bool RmgrIdIsCustom(int rmid)
static bool RmgrIdIsBuiltin(int rmid)
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)
static RmgrData GetRmgr(RmgrId rmid)
static bool RmgrIdExists(RmgrId rmid)