PostgreSQL Source Code: src/bin/pg_basebackup/astreamer_inject.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
13
17
19{
28
35
40};
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
66 bool is_recovery_guc_supported,
68{
70
77
78 return &streamer->base;
79}
80
81
82
83
84static void
89{
91
94
95 switch (context)
96 {
98
100
101
102
103
104
106 {
108 (strcmp(member->pathname, "standby.signal") == 0);
110 (strcmp(member->pathname, "postgresql.auto.conf") == 0);
112 {
113
115
116
119
120
121
122
123
124
127 }
128 }
129 else
131 (strcmp(member->pathname, "recovery.conf") == 0);
132
133
135 return;
136 break;
137
139
141 return;
142 break;
143
145
147 return;
148
149
155 break;
156
159 {
160
161
162
163
164
167 "postgresql.auto.conf",
170
171
173 "standby.signal", "", 0);
174 }
175 else
176 {
177
179 "recovery.conf",
182 }
183
184
185 break;
186
187 default:
188
189 pg_fatal("unexpected state while injecting recovery settings");
190 }
191
194}
195
196
197
198
199static void
201{
203}
204
205
206
207
208static void
210{
213}
214
215
216
217
218void
221{
223
230
231
232
233
234
235 member.uid = 04000;
236 member.gid = 02000;
237
238
239
240
241
242
249}
static void astreamer_free(astreamer *streamer)
static void astreamer_content(astreamer *streamer, astreamer_member *member, const char *data, int len, astreamer_archive_context context)
static void astreamer_finalize(astreamer *streamer)
astreamer_archive_context
@ ASTREAMER_MEMBER_HEADER
@ ASTREAMER_MEMBER_CONTENTS
@ ASTREAMER_MEMBER_TRAILER
@ ASTREAMER_ARCHIVE_TRAILER
static void astreamer_recovery_injector_content(astreamer *streamer, astreamer_member *member, const char *data, int len, astreamer_archive_context context)
astreamer * astreamer_recovery_injector_new(astreamer *next, bool is_recovery_guc_supported, PQExpBuffer recoveryconfcontents)
struct astreamer_recovery_injector astreamer_recovery_injector
static void astreamer_recovery_injector_finalize(astreamer *streamer)
static void astreamer_recovery_injector_free(astreamer *streamer)
static const astreamer_ops astreamer_recovery_injector_ops
void astreamer_inject_file(astreamer *streamer, char *pathname, char *data, int len)
Assert(PointerIsAligned(start, uint64))
void pfree(void *pointer)
void * palloc0(Size size)
static PQExpBuffer recoveryconfcontents
size_t strlcpy(char *dst, const char *src, size_t siz)
char linktarget[MAXPGPATH]
void(* content)(astreamer *streamer, astreamer_member *member, const char *data, int len, astreamer_archive_context context)
bool found_postgresql_auto_conf
bool is_recovery_guc_supported
bool is_postgresql_auto_conf
PQExpBuffer recoveryconfcontents
const astreamer_ops * bbs_ops