-
Notifications
You must be signed in to change notification settings - Fork 1
/
restart_gucs.c
62 lines (43 loc) · 2.33 KB
/
restart_gucs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "pgsampler.h"
/* Send info about the list of server restart required GUCs */
char* restart_gucs(void) {
char* result;
char blk_size[10];
StringInfoData resultbuf;
sprintf(blk_size, "%d", BLCKSZ);
//elog(LOG, "PRMGUC");
initStringInfo(&resultbuf);
appendStringInfo(&resultbuf, "PRMGUC;");
appendStringInfoString(&resultbuf, GetConfigOption("shared_buffers", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("max_connections", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("wal_level", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, blk_size);
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("listen_addresses", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("wal_buffers", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("max_wal_senders", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("autovacuum_max_workers", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("autovacuum_freeze_max_age", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("autovacuum_multixact_freeze_max_age", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("max_locks_per_transaction", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("max_pred_locks_per_transaction", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("wal_segment_size", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, GetConfigOption("data_directory", true, true));
appendStringInfo(&resultbuf, FIELD_DELIMIT);
appendStringInfoString(&resultbuf, CDELIMIT);
result = palloc(strlen(resultbuf.data) + 1);
strcpy(result, resultbuf.data);
return result;
}