PostgreSQL Source Code: src/backend/utils/error/csvlog.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
29
30
31
32
33
34
35
36static inline void
38{
39 const char *p = data;
40 char c;
41
42
43 if (p == NULL)
44 return;
45
47 while ((c = *p++) != '\0')
48 {
49 if (c == '"')
52 }
54}
55
56
57
58
59
60
61
62void
64{
66 bool print_stmt = false;
67
68
69 static long log_line_number = 0;
70
71
72 static int log_my_pid = 0;
73
74
75
76
77
78
80 {
81 log_line_number = 0;
84 }
85 log_line_number++;
86
88
89
92
93
97
98
102
103
107
108
110 {
114 {
117 }
119 }
121
122
125
126
129
130
132 {
134 const char *psdisp;
135 int displen;
136
138
142
144 }
146
147
150
151
152
156
157
160
161
164
165
168
169
172
173
176 else
179
180
183
184
187
188
192
193
197
198
200 if (print_stmt)
203 if (print_stmt && edata->cursorpos > 0)
206
207
209 {
211
213
223 }
225
226
229
231
232
235
236
238 {
240
241
242
243
244
247 }
249
250
252
254
255
258 else
260
262}
uint64 pgstat_get_my_query_id(void)
static void appendCSVLiteral(StringInfo buf, const char *data)
void write_csvlog(ErrorData *edata)
bool check_log_of_query(ErrorData *edata)
const char * error_severity(int elevel)
char * get_formatted_start_time(void)
void write_pipe_chunks(char *data, int len, int dest)
const char * get_backend_type_for_log(void)
char * get_formatted_log_time(void)
char * unpack_sql_state(int sql_state)
void reset_formatted_start_time(void)
#define LOG_DESTINATION_CSVLOG
void pfree(void *pointer)
BackendType MyBackendType
const char * debug_query_string
#define INVALID_PROC_NUMBER
const char * get_ps_display(int *displen)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
#define appendStringInfoCharMacro(str, ch)
void write_syslogger_file(const char *buffer, int count, int destination)
TransactionId GetTopTransactionIdIfAny(void)