PostgreSQL Source Code  git master
elog.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * elog.h
4  * POSTGRES error reporting/logging definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/utils/elog.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef ELOG_H
15 #define ELOG_H
16 
17 #include <setjmp.h>
18 
19 #include "lib/stringinfo.h"
20 
21 /* Error level codes */
22 #define DEBUG5 10 /* Debugging messages, in categories of
23  * decreasing detail. */
24 #define DEBUG4 11
25 #define DEBUG3 12
26 #define DEBUG2 13
27 #define DEBUG1 14 /* used by GUC debug_* variables */
28 #define LOG 15 /* Server operational messages; sent only to
29  * server log by default. */
30 #define LOG_SERVER_ONLY 16 /* Same as LOG for server reporting, but never
31  * sent to client. */
32 #define COMMERROR LOG_SERVER_ONLY /* Client communication problems; same as
33  * LOG for server reporting, but never
34  * sent to client. */
35 #define INFO 17 /* Messages specifically requested by user (eg
36  * VACUUM VERBOSE output); always sent to
37  * client regardless of client_min_messages,
38  * but by default not sent to server log. */
39 #define NOTICE 18 /* Helpful messages to users about query
40  * operation; sent to client and not to server
41  * log by default. */
42 #define WARNING 19 /* Warnings. NOTICE is for expected messages
43  * like implicit sequence creation by SERIAL.
44  * WARNING is for unexpected messages. */
45 #define PGWARNING 19 /* Must equal WARNING; see NOTE below. */
46 #define WARNING_CLIENT_ONLY 20 /* Warnings to be sent to client as usual, but
47  * never to the server log. */
48 #define ERROR 21 /* user error - abort transaction; return to
49  * known state */
50 #define PGERROR 21 /* Must equal ERROR; see NOTE below. */
51 #define FATAL 22 /* fatal error - abort process */
52 #define PANIC 23 /* take down the other backends with me */
53 
54 /*
55  * NOTE: the alternate names PGWARNING and PGERROR are useful for dealing
56  * with third-party headers that make other definitions of WARNING and/or
57  * ERROR. One can, for example, re-define ERROR as PGERROR after including
58  * such a header.
59  */
60 
61 
62 /* macros for representing SQLSTATE strings compactly */
63 #define PGSIXBIT(ch) (((ch) - '0') & 0x3F)
64 #define PGUNSIXBIT(val) (((val) & 0x3F) + '0')
65 
66 #define MAKE_SQLSTATE(ch1,ch2,ch3,ch4,ch5) \
67  (PGSIXBIT(ch1) + (PGSIXBIT(ch2) << 6) + (PGSIXBIT(ch3) << 12) + \
68  (PGSIXBIT(ch4) << 18) + (PGSIXBIT(ch5) << 24))
69 
70 /* These macros depend on the fact that '0' becomes a zero in PGSIXBIT */
71 #define ERRCODE_TO_CATEGORY(ec) ((ec) & ((1 << 12) - 1))
72 #define ERRCODE_IS_CATEGORY(ec) (((ec) & ~((1 << 12) - 1)) == 0)
73 
74 /* SQLSTATE codes for errors are defined in a separate file */
75 #include "utils/errcodes.h"
76 
77 /*
78  * Provide a way to prevent "errno" from being accidentally used inside an
79  * elog() or ereport() invocation. Since we know that some operating systems
80  * define errno as something involving a function call, we'll put a local
81  * variable of the same name as that function in the local scope to force a
82  * compile error. On platforms that don't define errno in that way, nothing
83  * happens, so we get no warning ... but we can live with that as long as it
84  * happens on some popular platforms.
85  */
86 #if defined(errno) && defined(__linux__)
87 #define pg_prevent_errno_in_scope() int __errno_location pg_attribute_unused()
88 #elif defined(errno) && (defined(__darwin__) || defined(__freebsd__))
89 #define pg_prevent_errno_in_scope() int __error pg_attribute_unused()
90 #else
91 #define pg_prevent_errno_in_scope()
92 #endif
93 
94 
95 /*----------
96  * New-style error reporting API: to be used in this way:
97  * ereport(ERROR,
98  * errcode(ERRCODE_UNDEFINED_CURSOR),
99  * errmsg("portal \"%s\" not found", stmt->portalname),
100  * ... other errxxx() fields as needed ...);
101  *
102  * The error level is required, and so is a primary error message (errmsg
103  * or errmsg_internal). All else is optional. errcode() defaults to
104  * ERRCODE_INTERNAL_ERROR if elevel is ERROR or more, ERRCODE_WARNING
105  * if elevel is WARNING, or ERRCODE_SUCCESSFUL_COMPLETION if elevel is
106  * NOTICE or below.
107  *
108  * Before Postgres v12, extra parentheses were required around the
109  * list of auxiliary function calls; that's now optional.
110  *
111  * ereport_domain() allows a message domain to be specified, for modules that
112  * wish to use a different message catalog from the backend's. To avoid having
113  * one copy of the default text domain per .o file, we define it as NULL here
114  * and have errstart insert the default text domain. Modules can either use
115  * ereport_domain() directly, or preferably they can override the TEXTDOMAIN
116  * macro.
117  *
118  * When __builtin_constant_p is available and elevel >= ERROR we make a call
119  * to errstart_cold() instead of errstart(). This version of the function is
120  * marked with pg_attribute_cold which will coax supporting compilers into
121  * generating code which is more optimized towards non-ERROR cases. Because
122  * we use __builtin_constant_p() in the condition, when elevel is not a
123  * compile-time constant, or if it is, but it's < ERROR, the compiler has no
124  * need to generate any code for this branch. It can simply call errstart()
125  * unconditionally.
126  *
127  * If elevel >= ERROR, the call will not return; we try to inform the compiler
128  * of that via pg_unreachable(). However, no useful optimization effect is
129  * obtained unless the compiler sees elevel as a compile-time constant, else
130  * we're just adding code bloat. So, if __builtin_constant_p is available,
131  * use that to cause the second if() to vanish completely for non-constant
132  * cases. We avoid using a local variable because it's not necessary and
133  * prevents gcc from making the unreachability deduction at optlevel -O0.
134  *----------
135  */
136 #ifdef HAVE__BUILTIN_CONSTANT_P
137 #define ereport_domain(elevel, domain, ...) \
138  do { \
139  pg_prevent_errno_in_scope(); \
140  if (__builtin_constant_p(elevel) && (elevel) >= ERROR ? \
141  errstart_cold(elevel, domain) : \
142  errstart(elevel, domain)) \
143  __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
144  if (__builtin_constant_p(elevel) && (elevel) >= ERROR) \
145  pg_unreachable(); \
146  } while(0)
147 #else /* !HAVE__BUILTIN_CONSTANT_P */
148 #define ereport_domain(elevel, domain, ...) \
149  do { \
150  const int elevel_ = (elevel); \
151  pg_prevent_errno_in_scope(); \
152  if (errstart(elevel_, domain)) \
153  __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
154  if (elevel_ >= ERROR) \
155  pg_unreachable(); \
156  } while(0)
157 #endif /* HAVE__BUILTIN_CONSTANT_P */
158 
159 #define ereport(elevel, ...) \
160  ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
161 
162 #define TEXTDOMAIN NULL
163 
164 extern bool message_level_is_interesting(int elevel);
165 
166 extern bool errstart(int elevel, const char *domain);
167 extern pg_attribute_cold bool errstart_cold(int elevel, const char *domain);
168 extern void errfinish(const char *filename, int lineno, const char *funcname);
169 
170 extern int errcode(int sqlerrcode);
171 
172 extern int errcode_for_file_access(void);
173 extern int errcode_for_socket_access(void);
174 
175 extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
176 extern int errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
177 
178 extern int errmsg_plural(const char *fmt_singular, const char *fmt_plural,
179  unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
180 
181 extern int errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
182 extern int errdetail_internal(const char *fmt,...) pg_attribute_printf(1, 2);
183 
184 extern int errdetail_log(const char *fmt,...) pg_attribute_printf(1, 2);
185 
186 extern int errdetail_log_plural(const char *fmt_singular,
187  const char *fmt_plural,
188  unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
189 
190 extern int errdetail_plural(const char *fmt_singular, const char *fmt_plural,
191  unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
192 
193 extern int errhint(const char *fmt,...) pg_attribute_printf(1, 2);
194 
195 extern int errhint_plural(const char *fmt_singular, const char *fmt_plural,
196  unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
197 
198 /*
199  * errcontext() is typically called in error context callback functions, not
200  * within an ereport() invocation. The callback function can be in a different
201  * module than the ereport() call, so the message domain passed in errstart()
202  * is not usually the correct domain for translating the context message.
203  * set_errcontext_domain() first sets the domain to be used, and
204  * errcontext_msg() passes the actual message.
205  */
206 #define errcontext set_errcontext_domain(TEXTDOMAIN), errcontext_msg
207 
208 extern int set_errcontext_domain(const char *domain);
209 
210 extern int errcontext_msg(const char *fmt,...) pg_attribute_printf(1, 2);
211 
212 extern int errhidestmt(bool hide_stmt);
213 extern int errhidecontext(bool hide_ctx);
214 
215 extern int errbacktrace(void);
216 
217 extern int errposition(int cursorpos);
218 
219 extern int internalerrposition(int cursorpos);
220 extern int internalerrquery(const char *query);
221 
222 extern int err_generic_string(int field, const char *str);
223 
224 extern int geterrcode(void);
225 extern int geterrposition(void);
226 extern int getinternalerrposition(void);
227 
228 
229 /*----------
230  * Old-style error reporting API: to be used in this way:
231  * elog(ERROR, "portal \"%s\" not found", stmt->portalname);
232  *----------
233  */
234 #define elog(elevel, ...) \
235  ereport(elevel, errmsg_internal(__VA_ARGS__))
236 
237 
238 /* Support for constructing error strings separately from ereport() calls */
239 
240 extern void pre_format_elog_string(int errnumber, const char *domain);
241 extern char *format_elog_string(const char *fmt,...) pg_attribute_printf(1, 2);
242 
243 
244 /* Support for attaching context information to error reports */
245 
246 typedef struct ErrorContextCallback
247 {
249  void (*callback) (void *arg);
250  void *arg;
252 
254 
255 
256 /*----------
257  * API for catching ereport(ERROR) exits. Use these macros like so:
258  *
259  * PG_TRY();
260  * {
261  * ... code that might throw ereport(ERROR) ...
262  * }
263  * PG_CATCH();
264  * {
265  * ... error recovery code ...
266  * }
267  * PG_END_TRY();
268  *
269  * (The braces are not actually necessary, but are recommended so that
270  * pgindent will indent the construct nicely.) The error recovery code
271  * can either do PG_RE_THROW to propagate the error outwards, or do a
272  * (sub)transaction abort. Failure to do so may leave the system in an
273  * inconsistent state for further processing.
274  *
275  * For the common case that the error recovery code and the cleanup in the
276  * normal code path are identical, the following can be used instead:
277  *
278  * PG_TRY();
279  * {
280  * ... code that might throw ereport(ERROR) ...
281  * }
282  * PG_FINALLY();
283  * {
284  * ... cleanup code ...
285  * }
286  * PG_END_TRY();
287  *
288  * The cleanup code will be run in either case, and any error will be rethrown
289  * afterwards.
290  *
291  * You cannot use both PG_CATCH() and PG_FINALLY() in the same
292  * PG_TRY()/PG_END_TRY() block.
293  *
294  * Note: while the system will correctly propagate any new ereport(ERROR)
295  * occurring in the recovery section, there is a small limit on the number
296  * of levels this will work for. It's best to keep the error recovery
297  * section simple enough that it can't generate any new errors, at least
298  * not before popping the error stack.
299  *
300  * Note: an ereport(FATAL) will not be caught by this construct; control will
301  * exit straight through proc_exit(). Therefore, do NOT put any cleanup
302  * of non-process-local resources into the error recovery section, at least
303  * not without taking thought for what will happen during ereport(FATAL).
304  * The PG_ENSURE_ERROR_CLEANUP macros provided by storage/ipc.h may be
305  * helpful in such cases.
306  *
307  * Note: if a local variable of the function containing PG_TRY is modified
308  * in the PG_TRY section and used in the PG_CATCH section, that variable
309  * must be declared "volatile" for POSIX compliance. This is not mere
310  * pedantry; we have seen bugs from compilers improperly optimizing code
311  * away when such a variable was not marked. Beware that gcc's -Wclobbered
312  * warnings are just about entirely useless for catching such oversights.
313  *
314  * Each of these macros accepts an optional argument which can be specified
315  * to apply a suffix to the variables declared within the macros. This suffix
316  * can be used to avoid the compiler emitting warnings about shadowed
317  * variables when compiling with -Wshadow in situations where nested PG_TRY()
318  * statements are required. The optional suffix may contain any character
319  * that's allowed in a variable name. The suffix, if specified, must be the
320  * same within each component macro of the given PG_TRY() statement.
321  *----------
322  */
323 #define PG_TRY(...) \
324  do { \
325  sigjmp_buf *_save_exception_stack##__VA_ARGS__ = PG_exception_stack; \
326  ErrorContextCallback *_save_context_stack##__VA_ARGS__ = error_context_stack; \
327  sigjmp_buf _local_sigjmp_buf##__VA_ARGS__; \
328  bool _do_rethrow##__VA_ARGS__ = false; \
329  if (sigsetjmp(_local_sigjmp_buf##__VA_ARGS__, 0) == 0) \
330  { \
331  PG_exception_stack = &_local_sigjmp_buf##__VA_ARGS__
332 
333 #define PG_CATCH(...) \
334  } \
335  else \
336  { \
337  PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
338  error_context_stack = _save_context_stack##__VA_ARGS__
339 
340 #define PG_FINALLY(...) \
341  } \
342  else \
343  _do_rethrow##__VA_ARGS__ = true; \
344  { \
345  PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
346  error_context_stack = _save_context_stack##__VA_ARGS__
347 
348 #define PG_END_TRY(...) \
349  } \
350  if (_do_rethrow##__VA_ARGS__) \
351  PG_RE_THROW(); \
352  PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
353  error_context_stack = _save_context_stack##__VA_ARGS__; \
354  } while (0)
355 
356 /*
357  * Some compilers understand pg_attribute_noreturn(); for other compilers,
358  * insert pg_unreachable() so that the compiler gets the point.
359  */
360 #ifdef HAVE_PG_ATTRIBUTE_NORETURN
361 #define PG_RE_THROW() \
362  pg_re_throw()
363 #else
364 #define PG_RE_THROW() \
365  (pg_re_throw(), pg_unreachable())
366 #endif
367 
368 extern PGDLLIMPORT sigjmp_buf *PG_exception_stack;
369 
370 
371 /* Stuff that error handlers might want to use */
372 
373 /*
374  * ErrorData holds the data accumulated during any one ereport() cycle.
375  * Any non-NULL pointers must point to palloc'd data.
376  * (The const pointers are an exception; we assume they point at non-freeable
377  * constant strings.)
378  */
379 typedef struct ErrorData
380 {
381  int elevel; /* error level */
382  bool output_to_server; /* will report to server log? */
383  bool output_to_client; /* will report to client? */
384  bool hide_stmt; /* true to prevent STATEMENT: inclusion */
385  bool hide_ctx; /* true to prevent CONTEXT: inclusion */
386  const char *filename; /* __FILE__ of ereport() call */
387  int lineno; /* __LINE__ of ereport() call */
388  const char *funcname; /* __func__ of ereport() call */
389  const char *domain; /* message domain */
390  const char *context_domain; /* message domain for context message */
391  int sqlerrcode; /* encoded ERRSTATE */
392  char *message; /* primary error message (translated) */
393  char *detail; /* detail error message */
394  char *detail_log; /* detail error message for server log only */
395  char *hint; /* hint message */
396  char *context; /* context message */
397  char *backtrace; /* backtrace */
398  const char *message_id; /* primary message's id (original string) */
399  char *schema_name; /* name of schema */
400  char *table_name; /* name of table */
401  char *column_name; /* name of column */
402  char *datatype_name; /* name of datatype */
403  char *constraint_name; /* name of constraint */
404  int cursorpos; /* cursor index into query string */
405  int internalpos; /* cursor index into internalquery */
406  char *internalquery; /* text of internally-generated query */
407  int saved_errno; /* errno at entry */
408 
409  /* context containing associated non-constant strings */
411 } ErrorData;
412 
413 extern void EmitErrorReport(void);
414 extern ErrorData *CopyErrorData(void);
415 extern void FreeErrorData(ErrorData *edata);
416 extern void FlushErrorState(void);
417 extern void ReThrowError(ErrorData *edata) pg_attribute_noreturn();
418 extern void ThrowErrorData(ErrorData *edata);
419 extern void pg_re_throw(void) pg_attribute_noreturn();
420 
421 extern char *GetErrorContextStack(void);
422 
423 /* Hook for intercepting messages before they are sent to the server log */
424 typedef void (*emit_log_hook_type) (ErrorData *edata);
426 
427 
428 /* GUC-configurable parameters */
429 
430 typedef enum
431 {
432  PGERROR_TERSE, /* single-line error messages */
433  PGERROR_DEFAULT, /* recommended style */
434  PGERROR_VERBOSE /* all the facts, ma'am */
436 
438 extern PGDLLIMPORT char *Log_line_prefix;
439 extern PGDLLIMPORT int Log_destination;
443 
444 /* Log destination bitmap */
445 #define LOG_DESTINATION_STDERR 1
446 #define LOG_DESTINATION_SYSLOG 2
447 #define LOG_DESTINATION_EVENTLOG 4
448 #define LOG_DESTINATION_CSVLOG 8
449 #define LOG_DESTINATION_JSONLOG 16
450 
451 /* Other exported functions */
452 extern void log_status_format(StringInfo buf, const char *format,
453  ErrorData *edata);
454 extern void DebugFileOpen(void);
455 extern char *unpack_sql_state(int sql_state);
456 extern bool in_error_recursion_trouble(void);
457 
458 /* Common functions shared across destinations */
459 extern void reset_formatted_start_time(void);
460 extern char *get_formatted_start_time(void);
461 extern char *get_formatted_log_time(void);
462 extern const char *get_backend_type_for_log(void);
463 extern bool check_log_of_query(ErrorData *edata);
464 extern const char *error_severity(int elevel);
465 extern void write_pipe_chunks(char *data, int len, int dest);
466 
467 /* Destination-specific functions */
468 extern void write_csvlog(ErrorData *edata);
469 extern void write_jsonlog(ErrorData *edata);
470 
471 /*
472  * Write errors to stderr (or by equal means when stderr is
473  * not available). Used before ereport/elog can be used
474  * safely (memory context, GUC load etc)
475  */
476 extern void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
477 
478 #endif /* ELOG_H */
#define PGDLLIMPORT
Definition: c.h:1252
#define pg_attribute_cold
Definition: c.h:259
#define pg_attribute_noreturn()
Definition: c.h:201
PGErrorVerbosity
Definition: elog.h:417
@ PGERROR_VERBOSE
Definition: elog.h:420
@ PGERROR_DEFAULT
Definition: elog.h:419
@ PGERROR_TERSE
Definition: elog.h:418
int getinternalerrposition(void)
Definition: elog.c:1431
int int int pg_attribute_printf(2, 4)
int int errhidestmt(bool hide_stmt)
Definition: elog.c:1247
PGDLLIMPORT int Log_error_verbosity
Definition: elog.c:110
PGDLLIMPORT int Log_destination
Definition: elog.c:112
struct ErrorData ErrorData
void(* emit_log_hook_type)(ErrorData *edata)
Definition: elog.h:410
int errcode_for_socket_access(void)
Definition: elog.c:789
int err_generic_string(int field, const char *str)
Definition: elog.c:1348
PGDLLIMPORT sigjmp_buf * PG_exception_stack
Definition: elog.c:96
int int errdetail_internal(const char *fmt,...) pg_attribute_printf(1
int errhint(const char *fmt,...) pg_attribute_printf(1
int internalerrquery(const char *query)
Definition: elog.c:1318
int internalerrposition(int cursorpos)
Definition: elog.c:1298
bool check_log_of_query(ErrorData *edata)
Definition: elog.c:2538
int geterrcode(void)
Definition: elog.c:1397
char * get_formatted_log_time(void)
Definition: elog.c:2464
bool errstart(int elevel, const char *domain)
Definition: elog.c:339
void EmitErrorReport(void)
Definition: elog.c:1506
int errdetail(const char *fmt,...) pg_attribute_printf(1
void DebugFileOpen(void)
Definition: elog.c:1918
void FreeErrorData(ErrorData *edata)
Definition: elog.c:1613
int errmsg(const char *fmt,...) pg_attribute_printf(1
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
int errcode_for_file_access(void)
Definition: elog.c:718
const char * error_severity(int elevel)
Definition: elog.c:3477
void pre_format_elog_string(int errnumber, const char *domain)
Definition: elog.c:1464
int int int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
int errbacktrace(void)
Definition: elog.c:928
char * format_elog_string(const char *fmt,...) pg_attribute_printf(1
void ReThrowError(ErrorData *edata) pg_attribute_noreturn()
Definition: elog.c:1735
const char * get_backend_type_for_log(void)
Definition: elog.c:2561
PGDLLIMPORT char * Log_destination_string
Definition: elog.c:113
void FlushErrorState(void)
Definition: elog.c:1651
void write_stderr(const char *fmt,...) pg_attribute_printf(1
PGDLLIMPORT emit_log_hook_type emit_log_hook
Definition: elog.c:107
int errcontext_msg(const char *fmt,...) pg_attribute_printf(1
void ThrowErrorData(ErrorData *edata)
Definition: elog.c:1676
bool message_level_is_interesting(int elevel)
Definition: elog.c:269
void write_pipe_chunks(char *data, int len, int dest)
Definition: elog.c:3239
int errhidecontext(bool hide_ctx)
Definition: elog.c:1266
int int int errdetail_log(const char *fmt,...) pg_attribute_printf(1
int geterrposition(void)
Definition: elog.c:1414
PGDLLIMPORT char * Log_line_prefix
Definition: elog.c:111
void write_csvlog(ErrorData *edata)
Definition: csvlog.c:65
char * unpack_sql_state(int sql_state)
Definition: elog.c:2976
pg_attribute_cold bool errstart_cold(int elevel, const char *domain)
Definition: elog.c:323
void write_jsonlog(ErrorData *edata)
Definition: jsonlog.c:111
int errcode(int sqlerrcode)
Definition: elog.c:695
int int errhint_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
PGDLLIMPORT bool syslog_split_messages
Definition: elog.c:115
PGDLLIMPORT ErrorContextCallback * error_context_stack
Definition: elog.c:94
void pg_re_throw(void) pg_attribute_noreturn()
Definition: elog.c:1796
PGDLLIMPORT bool syslog_sequence_numbers
Definition: elog.c:114
char struct ErrorContextCallback ErrorContextCallback
void log_status_format(StringInfo buf, const char *format, ErrorData *edata)
Definition: elog.c:2623
char * GetErrorContextStack(void)
Definition: elog.c:1851
bool in_error_recursion_trouble(void)
Definition: elog.c:290
void errfinish(const char *filename, int lineno, const char *funcname)
Definition: elog.c:512
int errposition(int cursorpos)
Definition: elog.c:1282
char * get_formatted_start_time(void)
Definition: elog.c:2514
int int int int errdetail_log_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
int set_errcontext_domain(const char *domain)
Definition: elog.c:1227
void reset_formatted_start_time(void)
Definition: elog.c:2502
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
ErrorData * CopyErrorData(void)
Definition: elog.c:1557
static void const char * fmt
void * arg
static char format
const void size_t len
const void * data
static char * filename
Definition: pg_dumpall.c:119
static char * buf
Definition: pg_test_fsync.c:67
struct ErrorContextCallback * previous
Definition: elog.h:234
int internalpos
Definition: elog.h:391
char * schema_name
Definition: elog.h:385
char * context
Definition: elog.h:382
const char * domain
Definition: elog.h:375
char * internalquery
Definition: elog.h:392
int saved_errno
Definition: elog.h:393
int sqlerrcode
Definition: elog.h:377
struct MemoryContextData * assoc_context
Definition: elog.h:396
const char * filename
Definition: elog.h:372
bool output_to_server
Definition: elog.h:368
int elevel
Definition: elog.h:367
char * datatype_name
Definition: elog.h:388
char * detail
Definition: elog.h:379
const char * context_domain
Definition: elog.h:376
const char * funcname
Definition: elog.h:374
char * table_name
Definition: elog.h:386
char * backtrace
Definition: elog.h:383
char * message
Definition: elog.h:378
bool hide_stmt
Definition: elog.h:370
char * detail_log
Definition: elog.h:380
int lineno
Definition: elog.h:373
const char * message_id
Definition: elog.h:384
char * hint
Definition: elog.h:381
bool hide_ctx
Definition: elog.h:371
char * constraint_name
Definition: elog.h:389
int cursorpos
Definition: elog.h:390
bool output_to_client
Definition: elog.h:369
char * column_name
Definition: elog.h:387
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
Definition: test_ifaddrs.c:46