PostgreSQL Source Code: src/backend/access/transam/rmgr.c Source File (original) (raw)
1
2
3
4
5
6
7
9
17#include "utils/fmgrprotos.h"
19
20
21
43
44
45
46
47#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask,decode) \
48 { name, redo, desc, identify, startup, cleanup, mask, decode },
49
53
54
55
56
57void
59{
60 for (int rmid = 0; rmid <= RM_MAX_ID; rmid++)
61 {
63 continue;
64
67 }
68}
69
70
71
72
73void
75{
76 for (int rmid = 0; rmid <= RM_MAX_ID; rmid++)
77 {
79 continue;
80
83 }
84}
85
86
87
88
89
90void
92{
93 ereport(ERROR, (errmsg("resource manager with ID %d not registered", rmid),
94 errhint("Include the extension module that implements this resource manager in \"shared_preload_libraries\".")));
95}
96
97
98
99
100
101
102
103
104
105
106void
108{
111 errhint("Provide a non-empty name for the custom resource manager.")));
112
114 ereport(ERROR, (errmsg("custom resource manager ID %d is out of range", rmid),
115 errhint("Provide a custom resource manager ID between %d and %d.",
117
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\".")));
122
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.",
128
129
131 {
133 continue;
134
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)));
139 }
140
141
144 (errmsg("registered custom resource manager \"%s\" with ID %d",
145 rmgr->rm_name, rmid)));
146}
147
148
151{
152#define PG_GET_RESOURCE_MANAGERS_COLS 3
156
158
159 for (int rmid = 0; rmid <= RM_MAX_ID; rmid++)
160 {
162 continue;
167 }
168
169 return (Datum) 0;
170}
static Datum values[MAXATTR]
#define CStringGetTextDatum(s)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#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)