PostgreSQL Source Code git master
Loading...
Searching...
No Matches
elog.h File Reference
#include <setjmp.h>
#include "lib/stringinfo.h"
#include "utils/errcodes.h"
Include dependency graph for elog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ErrorContextCallback
 
struct  ErrorData
 

Macros

#define DEBUG5
 
#define DEBUG4   11
 
#define DEBUG3   12
 
#define DEBUG2   13
 
#define DEBUG1   14 /* used by GUC debug_* variables */
 
#define LOG
 
#define LOG_SERVER_ONLY
 
#define COMMERROR
 
#define INFO
 
#define NOTICE
 
#define WARNING
 
#define PGWARNING   19 /* Must equal WARNING; see NOTE below. */
 
#define WARNING_CLIENT_ONLY
 
#define ERROR
 
#define PGERROR   21 /* Must equal ERROR; see NOTE below. */
 
#define FATAL   22 /* fatal error - abort process */
 
#define PANIC   23 /* take down the other backends with me */
 
#define PGSIXBIT(ch)   (((ch) - '0') & 0x3F)
 
#define PGUNSIXBIT(val)   (((val) & 0x3F) + '0')
 
#define MAKE_SQLSTATE(ch1, ch2, ch3, ch4, ch5)
 
#define ERRCODE_TO_CATEGORY(ec)   ((ec) & ((1 << 12) - 1))
 
#define ERRCODE_IS_CATEGORY(ec)   (((ec) & ~((1 << 12) - 1)) == 0)
 
#define pg_prevent_errno_in_scope()
 
#define ereport_domain(elevel, domain, ...)
 
#define ereport(elevel, ...)    ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
 
#define TEXTDOMAIN   NULL
 
#define errcontext   set_errcontext_domain(TEXTDOMAIN), errcontext_msg
 
#define elog(elevel, ...)    ereport(elevel, errmsg_internal(__VA_ARGS__))
 
#define errsave_domain(context, domain, ...)
 
#define errsave(context, ...)    errsave_domain(context, TEXTDOMAIN, __VA_ARGS__)
 
#define ereturn_domain(context, dummy_value, domain, ...)
 
#define ereturn(context, dummy_value, ...)    ereturn_domain(context, dummy_value, TEXTDOMAIN, __VA_ARGS__)
 
#define PG_TRY(...)
 
#define PG_CATCH(...)
 
#define PG_FINALLY(...)
 
#define PG_END_TRY(...)
 
#define PG_RE_THROW()    pg_re_throw()
 
#define LOG_DESTINATION_STDERR   1
 
#define LOG_DESTINATION_SYSLOG   2
 
#define LOG_DESTINATION_EVENTLOG   4
 
#define LOG_DESTINATION_CSVLOG   8
 
#define LOG_DESTINATION_JSONLOG   16
 

Typedefs

typedef char struct ErrorContextCallback ErrorContextCallback
 
typedef struct ErrorData ErrorData
 
typedef void(* emit_log_hook_type) (ErrorData *edata)
 

Enumerations

enum  PGErrorVerbosity { PGERROR_TERSE , PGERROR_DEFAULT , PGERROR_VERBOSE }
 

Functions

bool message_level_is_interesting (int elevel)
 
bool errstart (int elevel, const char *domain)
 
pg_attribute_cold bool errstart_cold (int elevel, const char *domain)
 
void errfinish (const char *filename, int lineno, const char *funcname)
 
int errcode (int sqlerrcode)
 
int errcode_for_file_access (void)
 
int errcode_for_socket_access (void)
 
int errmsg (const char *fmt,...) pg_attribute_printf(1
 
int int errmsg_internal (const char *fmt,...) pg_attribute_printf(1
 
int int int errmsg_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
 
int int int pg_attribute_printf (2, 4)
 
int errdetail (const char *fmt,...) pg_attribute_printf(1
 
int int errdetail_internal (const char *fmt,...) pg_attribute_printf(1
 
int int int errdetail_log (const char *fmt,...) pg_attribute_printf(1
 
int int int int errdetail_log_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
 
int errdetail_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
 
int errhint (const char *fmt,...) pg_attribute_printf(1
 
int int errhint_internal (const char *fmt,...) pg_attribute_printf(1
 
int int int errhint_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
 
int set_errcontext_domain (const char *domain)
 
int errcontext_msg (const char *fmt,...) pg_attribute_printf(1
 
int int errhidestmt (bool hide_stmt)
 
int errhidecontext (bool hide_ctx)
 
int errbacktrace (void)
 
int errposition (int cursorpos)
 
int internalerrposition (int cursorpos)
 
int internalerrquery (const char *query)
 
int err_generic_string (int field, const char *str)
 
int geterrcode (void)
 
int geterrposition (void)
 
int getinternalerrposition (void)
 
bool errsave_start (struct Node *context, const char *domain)
 
void errsave_finish (struct Node *context, const char *filename, int lineno, const char *funcname)
 
void pre_format_elog_string (int errnumber, const char *domain)
 
charformat_elog_string (const char *fmt,...) pg_attribute_printf(1
 
void EmitErrorReport (void)
 
ErrorDataCopyErrorData (void)
 
void FreeErrorData (ErrorData *edata)
 
void FlushErrorState (void)
 
pg_noreturn void ReThrowError (ErrorData *edata)
 
void ThrowErrorData (ErrorData *edata)
 
pg_noreturn void pg_re_throw (void)
 
charGetErrorContextStack (void)
 
void log_status_format (StringInfo buf, const char *format, ErrorData *edata)
 
void DebugFileOpen (void)
 
charunpack_sql_state (int sql_state)
 
bool in_error_recursion_trouble (void)
 
void reset_formatted_start_time (void)
 
charget_formatted_start_time (void)
 
charget_formatted_log_time (void)
 
const charget_backend_type_for_log (void)
 
bool check_log_of_query (ErrorData *edata)
 
const charerror_severity (int elevel)
 
void write_pipe_chunks (char *data, int len, int dest)
 
void write_csvlog (ErrorData *edata)
 
void write_jsonlog (ErrorData *edata)
 
void write_stderr (const char *fmt,...) pg_attribute_printf(1
 
void void vwrite_stderr (const char *fmt, va_list ap) pg_attribute_printf(1
 

Variables

PGDLLIMPORT ErrorContextCallbackerror_context_stack
 
PGDLLIMPORT sigjmp_bufPG_exception_stack
 
PGDLLIMPORT emit_log_hook_type emit_log_hook
 
PGDLLIMPORT int Log_error_verbosity
 
PGDLLIMPORT charLog_line_prefix
 
PGDLLIMPORT int Log_destination
 
PGDLLIMPORT charLog_destination_string
 
PGDLLIMPORT bool syslog_sequence_numbers
 
PGDLLIMPORT bool syslog_split_messages
 

Macro Definition Documentation

◆ COMMERROR

#define COMMERROR
Value:
LOG_SERVER_ONLY /* Client communication problems; same as
* LOG for server reporting, but never
* sent to client. */
#define LOG_SERVER_ONLY
Definition elog.h:32

Definition at line 33 of file elog.h.

143{ \
145 if (pg_integer_constant_p(elevel) && (elevel) >= ERROR ? \
146 errstart_cold(elevel, domain) : \
147 errstart(elevel, domain)) \
149 if (pg_integer_constant_p(elevel) && (elevel) >= ERROR) \
151 } while(0)
152#else /* !HAVE_PG_INTEGER_CONSTANT_P */
153#define ereport_domain(elevel, domain, ...) \
154 do { \
155 const int elevel_ = (elevel); \
156 pg_prevent_errno_in_scope(); \
157 if (errstart(elevel_, domain)) \
158 __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
159 if (elevel_ >= ERROR) \
160 pg_unreachable(); \
161 } while(0)
162#endif /* HAVE_PG_INTEGER_CONSTANT_P */
163
164#define ereport(elevel, ...) \
165 ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)
166
167#define TEXTDOMAIN NULL
168
169extern bool message_level_is_interesting(int elevel);
170
171extern bool errstart(int elevel, const char *domain);
172extern pg_attribute_cold bool errstart_cold(int elevel, const char *domain);
173extern void errfinish(const char *filename, int lineno, const char *funcname);
174
175extern int errcode(int sqlerrcode);
176
177extern int errcode_for_file_access(void);
178extern int errcode_for_socket_access(void);
179
180extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
182
184 unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
185
186extern int errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
188
190
192 const char *fmt_plural,
193 unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
194
196 unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
197
198extern int errhint(const char *fmt,...) pg_attribute_printf(1, 2);
200
202 unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
203
204/*
205 * errcontext() is typically called in error context callback functions, not
206 * within an ereport() invocation. The callback function can be in a different
207 * module than the ereport() call, so the message domain passed in errstart()
208 * is not usually the correct domain for translating the context message.
209 * set_errcontext_domain() first sets the domain to be used, and
210 * errcontext_msg() passes the actual message.
211 */
212#define errcontext set_errcontext_domain(TEXTDOMAIN), errcontext_msg
213
214extern int set_errcontext_domain(const char *domain);
215
216extern int errcontext_msg(const char *fmt,...) pg_attribute_printf(1, 2);
217
218extern int errhidestmt(bool hide_stmt);
219extern int errhidecontext(bool hide_ctx);
220
221extern int errbacktrace(void);
222
223extern int errposition(int cursorpos);
224
225extern int internalerrposition(int cursorpos);
226extern int internalerrquery(const char *query);
227
228extern int err_generic_string(int field, const char *str);
229
230extern int geterrcode(void);
231extern int geterrposition(void);
233
234
235/*----------
236 * Old-style error reporting API: to be used in this way:
237 * elog(ERROR, "portal \"%s\" not found", stmt->portalname);
238 *----------
239 */
240#define elog(elevel, ...) \
241 ereport(elevel, errmsg_internal(__VA_ARGS__))
242
243
244/*----------
245 * Support for reporting "soft" errors that don't require a full transaction
246 * abort to clean up. This is to be used in this way:
247 * errsave(context,
248 * errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
249 * errmsg("invalid input syntax for type %s: \"%s\"",
250 * "boolean", in_str),
251 * ... other errxxx() fields as needed ...);
252 *
253 * "context" is a node pointer or NULL, and the remaining auxiliary calls
254 * provide the same error details as in ereport(). If context is not a
255 * pointer to an ErrorSaveContext node, then errsave(context, ...)
256 * behaves identically to ereport(ERROR, ...). If context is a pointer
257 * to an ErrorSaveContext node, then the information provided by the
258 * auxiliary calls is stored in the context node and control returns
259 * normally. The caller of errsave() must then do any required cleanup
260 * and return control back to its caller. That caller must check the
261 * ErrorSaveContext node to see whether an error occurred before
262 * it can trust the function's result to be meaningful.
263 *
264 * errsave_domain() allows a message domain to be specified; it is
265 * precisely analogous to ereport_domain().
266 *----------
267 */
268#define errsave_domain(context, domain, ...) \
269 do { \
270 struct Node *context_ = (context); \
271 pg_prevent_errno_in_scope(); \
272 if (errsave_start(context_, domain)) \
273 __VA_ARGS__, errsave_finish(context_, __FILE__, __LINE__, __func__); \
274 } while(0)
275
276#define errsave(context, ...) \
277 errsave_domain(context, TEXTDOMAIN, __VA_ARGS__)
278
279/*
280 * "ereturn(context, dummy_value, ...);" is exactly the same as
281 * "errsave(context, ...); return dummy_value;". This saves a bit
282 * of typing in the common case where a function has no cleanup
283 * actions to take after reporting a soft error. "dummy_value"
284 * can be empty if the function returns void.
285 */
286#define ereturn_domain(context, dummy_value, domain, ...) \
287 do { \
288 errsave_domain(context, domain, __VA_ARGS__); \
289 return dummy_value; \
290 } while(0)
291
292#define ereturn(context, dummy_value, ...) \
293 ereturn_domain(context, dummy_value, TEXTDOMAIN, __VA_ARGS__)
294
295extern bool errsave_start(struct Node *context, const char *domain);
296extern void errsave_finish(struct Node *context,
297 const char *filename, int lineno,
298 const char *funcname);
299
300
301/* Support for constructing error strings separately from ereport() calls */
302
303extern void pre_format_elog_string(int errnumber, const char *domain);
304extern char *format_elog_string(const char *fmt,...) pg_attribute_printf(1, 2);
305
306
307/* Support for attaching context information to error reports */
308
310{
312 void (*callback) (void *arg);
313 void *arg;
315
317
318
319/*----------
320 * API for catching ereport(ERROR) exits. Use these macros like so:
321 *
322 * PG_TRY();
323 * {
324 * ... code that might throw ereport(ERROR) ...
325 * }
326 * PG_CATCH();
327 * {
328 * ... error recovery code ...
329 * }
330 * PG_END_TRY();
331 *
332 * (The braces are not actually necessary, but are recommended so that
333 * pgindent will indent the construct nicely.) The error recovery code
334 * can either do PG_RE_THROW to propagate the error outwards, or do a
335 * (sub)transaction abort. Failure to do so may leave the system in an
336 * inconsistent state for further processing.
337 *
338 * For the common case that the error recovery code and the cleanup in the
339 * normal code path are identical, the following can be used instead:
340 *
341 * PG_TRY();
342 * {
343 * ... code that might throw ereport(ERROR) ...
344 * }
345 * PG_FINALLY();
346 * {
347 * ... cleanup code ...
348 * }
349 * PG_END_TRY();
350 *
351 * The cleanup code will be run in either case, and any error will be rethrown
352 * afterwards.
353 *
354 * You cannot use both PG_CATCH() and PG_FINALLY() in the same
355 * PG_TRY()/PG_END_TRY() block.
356 *
357 * Note: while the system will correctly propagate any new ereport(ERROR)
358 * occurring in the recovery section, there is a small limit on the number
359 * of levels this will work for. It's best to keep the error recovery
360 * section simple enough that it can't generate any new errors, at least
361 * not before popping the error stack.
362 *
363 * Note: an ereport(FATAL) will not be caught by this construct; control will
364 * exit straight through proc_exit(). Therefore, do NOT put any cleanup
365 * of non-process-local resources into the error recovery section, at least
366 * not without taking thought for what will happen during ereport(FATAL).
367 * The PG_ENSURE_ERROR_CLEANUP macros provided by storage/ipc.h may be
368 * helpful in such cases.
369 *
370 * Note: if a local variable of the function containing PG_TRY is modified
371 * in the PG_TRY section and used in the PG_CATCH section, that variable
372 * must be declared "volatile" for POSIX compliance. This is not mere
373 * pedantry; we have seen bugs from compilers improperly optimizing code
374 * away when such a variable was not marked. Beware that gcc's -Wclobbered
375 * warnings are just about entirely useless for catching such oversights.
376 *
377 * Each of these macros accepts an optional argument which can be specified
378 * to apply a suffix to the variables declared within the macros. This suffix
379 * can be used to avoid the compiler emitting warnings about shadowed
380 * variables when compiling with -Wshadow in situations where nested PG_TRY()
381 * statements are required. The optional suffix may contain any character
382 * that's allowed in a variable name. The suffix, if specified, must be the
383 * same within each component macro of the given PG_TRY() statement.
384 *----------
385 */
386#define PG_TRY(...) \
387 do { \
388 sigjmp_buf *_save_exception_stack##__VA_ARGS__ = PG_exception_stack; \
389 ErrorContextCallback *_save_context_stack##__VA_ARGS__ = error_context_stack; \
390 sigjmp_buf _local_sigjmp_buf##__VA_ARGS__; \
391 bool _do_rethrow##__VA_ARGS__ = false; \
392 if (sigsetjmp(_local_sigjmp_buf##__VA_ARGS__, 0) == 0) \
393 { \
394 PG_exception_stack = &_local_sigjmp_buf##__VA_ARGS__
395
396#define PG_CATCH(...) \
397 } \
398 else \
399 { \
400 PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
401 error_context_stack = _save_context_stack##__VA_ARGS__
402
403#define PG_FINALLY(...) \
404 } \
405 else \
406 _do_rethrow##__VA_ARGS__ = true; \
407 { \
408 PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
409 error_context_stack = _save_context_stack##__VA_ARGS__
410
411#define PG_END_TRY(...) \
412 } \
413 if (_do_rethrow##__VA_ARGS__) \
414 PG_RE_THROW(); \
415 PG_exception_stack = _save_exception_stack##__VA_ARGS__; \
416 error_context_stack = _save_context_stack##__VA_ARGS__; \
417 } while (0)
418
419#define PG_RE_THROW() \
420 pg_re_throw()
421
423
424
425/* Stuff that error handlers might want to use */
426
427/*
428 * ErrorData holds the data accumulated during any one ereport() cycle.
429 * Any non-NULL pointers must point to palloc'd data.
430 * (The const pointers are an exception; we assume they point at non-freeable
431 * constant strings.)
432 */
433typedef struct ErrorData
434{
435 int elevel; /* error level */
436 bool output_to_server; /* will report to server log? */
437 bool output_to_client; /* will report to client? */
438 bool hide_stmt; /* true to prevent STATEMENT: inclusion */
439 bool hide_ctx; /* true to prevent CONTEXT: inclusion */
440 const char *filename; /* __FILE__ of ereport() call */
441 int lineno; /* __LINE__ of ereport() call */
442 const char *funcname; /* __func__ of ereport() call */
443 const char *domain; /* message domain */
444 const char *context_domain; /* message domain for context message */
445 int sqlerrcode; /* encoded ERRSTATE */
446 char *message; /* primary error message (translated) */
447 char *detail; /* detail error message */
448 char *detail_log; /* detail error message for server log only */
449 char *hint; /* hint message */
450 char *context; /* context message */
451 char *backtrace; /* backtrace */
452 const char *message_id; /* primary message's id (original string) */
453 char *schema_name; /* name of schema */
454 char *table_name; /* name of table */
455 char *column_name; /* name of column */
456 char *datatype_name; /* name of datatype */
457 char *constraint_name; /* name of constraint */
458 int cursorpos; /* cursor index into query string */
459 int internalpos; /* cursor index into internalquery */
460 char *internalquery; /* text of internally-generated query */
461 int saved_errno; /* errno at entry */
462
463 /* context containing associated non-constant strings */
465} ErrorData;
466
467extern void EmitErrorReport(void);
468extern ErrorData *CopyErrorData(void);
469extern void FreeErrorData(ErrorData *edata);
470extern void FlushErrorState(void);
472extern void ThrowErrorData(ErrorData *edata);
473pg_noreturn extern void pg_re_throw(void);
474
475extern char *GetErrorContextStack(void);
476
477/* Hook for intercepting messages before they are sent to the server log */
480
481
482/* GUC-configurable parameters */
483
484typedef enum
485{
486 PGERROR_TERSE, /* single-line error messages */
487 PGERROR_DEFAULT, /* recommended style */
488 PGERROR_VERBOSE, /* all the facts, ma'am */
490
492extern PGDLLIMPORT char *Log_line_prefix;
497
498/* Log destination bitmap */
499#define LOG_DESTINATION_STDERR 1
500#define LOG_DESTINATION_SYSLOG 2
501#define LOG_DESTINATION_EVENTLOG 4
502#define LOG_DESTINATION_CSVLOG 8
503#define LOG_DESTINATION_JSONLOG 16
504
505/* Other exported functions */
506extern void log_status_format(StringInfo buf, const char *format,
508extern void DebugFileOpen(void);
509extern char *unpack_sql_state(int sql_state);
510extern bool in_error_recursion_trouble(void);
511
512/* Common functions shared across destinations */
513extern void reset_formatted_start_time(void);
514extern char *get_formatted_start_time(void);
515extern char *get_formatted_log_time(void);
516extern const char *get_backend_type_for_log(void);
518extern const char *error_severity(int elevel);
519extern void write_pipe_chunks(char *data, int len, int dest);
520
521/* Destination-specific functions */
522extern void write_csvlog(ErrorData *edata);
523extern void write_jsonlog(ErrorData *edata);
524
525/*
526 * Write errors to stderr (or by equal means when stderr is
527 * not available). Used before ereport/elog can be used
528 * safely (memory context, GUC load etc)
529 */
530extern void write_stderr(const char *fmt,...) pg_attribute_printf(1, 2);
532
533#endif /* ELOG_H */
#define write_stderr(str)
Definition parallel.c:186
#define PGDLLIMPORT
Definition c.h:1356
#define pg_attribute_cold
Definition c.h:332
#define pg_noreturn
Definition c.h:176
#define pg_attribute_printf(f, a)
Definition c.h:254
Datum arg
Definition elog.c:1322
PGErrorVerbosity
Definition elog.h:471
@ PGERROR_VERBOSE
Definition elog.h:474
@ PGERROR_DEFAULT
Definition elog.h:473
@ PGERROR_TERSE
Definition elog.h:472
int getinternalerrposition(void)
int int errhidestmt(bool hide_stmt)
PGDLLIMPORT int Log_error_verbosity
Definition elog.c:113
PGDLLIMPORT int Log_destination
Definition elog.c:115
void(* emit_log_hook_type)(ErrorData *edata)
Definition elog.h:464
int errcode_for_socket_access(void)
Definition elog.c:976
bool errsave_start(struct Node *context, const char *domain)
Definition elog.c:650
int err_generic_string(int field, const char *str)
PGDLLIMPORT sigjmp_buf * PG_exception_stack
Definition elog.c:101
int int errdetail_internal(const char *fmt,...) pg_attribute_printf(1
void errsave_finish(struct Node *context, const char *filename, int lineno, const char *funcname)
Definition elog.c:702
int errhint(const char *fmt,...) pg_attribute_printf(1
int internalerrquery(const char *query)
int int int errhint_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
int internalerrposition(int cursorpos)
bool check_log_of_query(ErrorData *edata)
Definition elog.c:3178
int geterrcode(void)
bool errstart(int elevel, const char *domain)
Definition elog.c:354
void EmitErrorReport(void)
Definition elog.c:1882
int errdetail(const char *fmt,...) pg_attribute_printf(1
char * GetErrorContextStack(void)
Definition elog.c:2254
void DebugFileOpen(void)
Definition elog.c:2306
void FreeErrorData(ErrorData *edata)
Definition elog.c:2013
const char * error_severity(int elevel)
Definition elog.c:4154
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:897
pg_noreturn void ReThrowError(ErrorData *edata)
Definition elog.c:2149
void pre_format_elog_string(int errnumber, const char *domain)
Definition elog.c:1840
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:1115
char * get_formatted_start_time(void)
Definition elog.c:3154
ErrorData * CopyErrorData(void)
Definition elog.c:1941
PGDLLIMPORT char * Log_destination_string
Definition elog.c:116
void FlushErrorState(void)
Definition elog.c:2062
PGDLLIMPORT emit_log_hook_type emit_log_hook
Definition elog.c:110
int errcontext_msg(const char *fmt,...) pg_attribute_printf(1
#define ERROR
Definition elog.h:39
void ThrowErrorData(ErrorData *edata)
Definition elog.c:2090
bool message_level_is_interesting(int elevel)
Definition elog.c:284
void write_pipe_chunks(char *data, int len, int dest)
Definition elog.c:3913
int errhidecontext(bool hide_ctx)
int int int errdetail_log(const char *fmt,...) pg_attribute_printf(1
int geterrposition(void)
PGDLLIMPORT char * Log_line_prefix
Definition elog.c:114
void write_csvlog(ErrorData *edata)
Definition csvlog.c:63
void void vwrite_stderr(const char *fmt, va_list ap) pg_attribute_printf(1
pg_attribute_cold bool errstart_cold(int elevel, const char *domain)
Definition elog.c:338
void write_jsonlog(ErrorData *edata)
Definition jsonlog.c:109
const char * get_backend_type_for_log(void)
Definition elog.c:3201
int errcode(int sqlerrcode)
Definition elog.c:874
pg_noreturn void pg_re_throw(void)
Definition elog.c:2199
PGDLLIMPORT bool syslog_split_messages
Definition elog.c:118
PGDLLIMPORT ErrorContextCallback * error_context_stack
Definition elog.c:99
PGDLLIMPORT bool syslog_sequence_numbers
Definition elog.c:117
char * format_elog_string(const char *fmt,...) pg_attribute_printf(1
void log_status_format(StringInfo buf, const char *format, ErrorData *edata)
Definition elog.c:3268
char * get_formatted_log_time(void)
Definition elog.c:3104
bool in_error_recursion_trouble(void)
Definition elog.c:305
void errfinish(const char *filename, int lineno, const char *funcname)
Definition elog.c:485
int errposition(int cursorpos)
char * unpack_sql_state(int sql_state)
Definition elog.c:3653
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)
void reset_formatted_start_time(void)
Definition elog.c:3142
int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
int int errhint_internal(const char *fmt,...) pg_attribute_printf(1
const char * str
#define funcname
static char format
const void size_t len
const void * data
static char * filename
Definition pg_dumpall.c:132
static char buf[DEFAULT_XLOG_SEG_SIZE]
static int fb(int x)
struct ErrorContextCallback * previous
Definition elog.h:297
int internalpos
Definition elog.h:445
char * schema_name
Definition elog.h:439
char * context
Definition elog.h:436
const char * domain
Definition elog.h:429
char * internalquery
Definition elog.h:446
int saved_errno
Definition elog.h:447
int sqlerrcode
Definition elog.h:431
struct MemoryContextData * assoc_context
Definition elog.h:450
const char * filename
Definition elog.h:426
bool output_to_server
Definition elog.h:422
int elevel
Definition elog.h:421
char * datatype_name
Definition elog.h:442
char * detail
Definition elog.h:433
const char * context_domain
Definition elog.h:430
const char * funcname
Definition elog.h:428
char * table_name
Definition elog.h:440
char * backtrace
Definition elog.h:437
char * message
Definition elog.h:432
bool hide_stmt
Definition elog.h:424
char * detail_log
Definition elog.h:434
int lineno
Definition elog.h:427
const char * message_id
Definition elog.h:438
char * hint
Definition elog.h:435
bool hide_ctx
Definition elog.h:425
char * constraint_name
Definition elog.h:443
int cursorpos
Definition elog.h:444
bool output_to_client
Definition elog.h:423
char * column_name
Definition elog.h:441
Definition nodes.h:135
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)

◆ DEBUG1

#define DEBUG1   14 /* used by GUC debug_* variables */

Definition at line 30 of file elog.h.

◆ DEBUG2

#define DEBUG2   13

Definition at line 29 of file elog.h.

◆ DEBUG3

#define DEBUG3   12

Definition at line 28 of file elog.h.

◆ DEBUG4

#define DEBUG4   11

Definition at line 27 of file elog.h.

◆ DEBUG5

#define DEBUG5
Value:
10 /* Debugging messages, in categories of
* decreasing detail. */

Definition at line 26 of file elog.h.

◆ elog

#define elog (   elevel,
  ... 
)     ereport(elevel, errmsg_internal(__VA_ARGS__))

Definition at line 226 of file elog.h.

◆ ereport

#define ereport (   elevel,
  ... 
)     ereport_domain(elevel, TEXTDOMAIN, __VA_ARGS__)

Definition at line 150 of file elog.h.

◆ ereport_domain

#define ereport_domain (   elevel,
  domain,
  ... 
)
Value:
do { \
const int elevel_ = (elevel); \
if (errstart(elevel_, domain)) \
} while(0)

Definition at line 139 of file elog.h.

143 { \
145 if (pg_integer_constant_p(elevel) && (elevel) >= ERROR ? \
146 errstart_cold(elevel, domain) : \
147 errstart(elevel, domain)) \

◆ ereturn

#define ereturn (   context,
  dummy_value,
  ... 
)     ereturn_domain(context, dummy_value, TEXTDOMAIN, __VA_ARGS__)

Definition at line 278 of file elog.h.

◆ ereturn_domain

#define ereturn_domain (   context,
  dummy_value,
  domain,
  ... 
)
Value:
do { \
errsave_domain(context, domain, __VA_ARGS__); \
return dummy_value; \
} while(0)

Definition at line 272 of file elog.h.

◆ ERRCODE_IS_CATEGORY

#define ERRCODE_IS_CATEGORY (   ec)    (((ec) & ~((1 << 12) - 1)) == 0)

Definition at line 62 of file elog.h.

◆ ERRCODE_TO_CATEGORY

#define ERRCODE_TO_CATEGORY (   ec)    ((ec) & ((1 << 12) - 1))

Definition at line 61 of file elog.h.

◆ errcontext

Definition at line 198 of file elog.h.

◆ ERROR

#define ERROR
Value:
21 /* user error - abort transaction; return to
* known state */

Definition at line 39 of file elog.h.

◆ errsave

#define errsave (   context,
  ... 
)     errsave_domain(context, TEXTDOMAIN, __VA_ARGS__)

Definition at line 262 of file elog.h.

◆ errsave_domain

#define errsave_domain (   context,
  domain,
  ... 
)
Value:

Definition at line 254 of file elog.h.

◆ FATAL

#define FATAL   22 /* fatal error - abort process */

Definition at line 41 of file elog.h.

◆ INFO

#define INFO
Value:
17 /* Messages specifically requested by user (eg
* VACUUM VERBOSE output); always sent to
* client regardless of client_min_messages,
* but by default not sent to server log. */

Definition at line 34 of file elog.h.

◆ LOG

#define LOG
Value:
15 /* Server operational messages; sent only to
* server log by default. */

Definition at line 31 of file elog.h.

◆ LOG_DESTINATION_CSVLOG

#define LOG_DESTINATION_CSVLOG   8

Definition at line 488 of file elog.h.

◆ LOG_DESTINATION_EVENTLOG

#define LOG_DESTINATION_EVENTLOG   4

Definition at line 487 of file elog.h.

◆ LOG_DESTINATION_JSONLOG

#define LOG_DESTINATION_JSONLOG   16

Definition at line 489 of file elog.h.

◆ LOG_DESTINATION_STDERR

#define LOG_DESTINATION_STDERR   1

Definition at line 485 of file elog.h.

◆ LOG_DESTINATION_SYSLOG

#define LOG_DESTINATION_SYSLOG   2

Definition at line 486 of file elog.h.

◆ LOG_SERVER_ONLY

#define LOG_SERVER_ONLY
Value:
16 /* Same as LOG for server reporting, but never
* sent to client. */

Definition at line 32 of file elog.h.

◆ MAKE_SQLSTATE

#define MAKE_SQLSTATE (   ch1,
  ch2,
  ch3,
  ch4,
  ch5 
)
Value:
(PGSIXBIT(ch1) + (PGSIXBIT(ch2) << 6) + (PGSIXBIT(ch3) << 12) + \
(PGSIXBIT(ch4) << 18) + (PGSIXBIT(ch5) << 24))
#define PGSIXBIT(ch)
Definition elog.h:53

Definition at line 56 of file elog.h.

◆ NOTICE

#define NOTICE
Value:
18 /* Helpful messages to users about query
* operation; sent to client and not to server
* log by default. */

Definition at line 35 of file elog.h.

◆ PANIC

#define PANIC   23 /* take down the other backends with me */

Definition at line 42 of file elog.h.

◆ PG_CATCH

#define PG_CATCH (   ...)
Value:

Definition at line 382 of file elog.h.

387 { \

◆ PG_END_TRY

#define PG_END_TRY (   ...)

◆ PG_FINALLY

◆ pg_prevent_errno_in_scope

#define pg_prevent_errno_in_scope ( )

Definition at line 81 of file elog.h.

◆ PG_RE_THROW

#define PG_RE_THROW ( )     pg_re_throw()

Definition at line 405 of file elog.h.

◆ PG_TRY

◆ PGERROR

#define PGERROR   21 /* Must equal ERROR; see NOTE below. */

Definition at line 40 of file elog.h.

◆ PGSIXBIT

#define PGSIXBIT (   ch)    (((ch) - '0') & 0x3F)

Definition at line 53 of file elog.h.

◆ PGUNSIXBIT

#define PGUNSIXBIT (   val)    (((val) & 0x3F) + '0')

Definition at line 54 of file elog.h.

◆ PGWARNING

#define PGWARNING   19 /* Must equal WARNING; see NOTE below. */

Definition at line 37 of file elog.h.

◆ TEXTDOMAIN

#define TEXTDOMAIN   NULL

Definition at line 153 of file elog.h.

◆ WARNING

#define WARNING
Value:
19 /* Warnings. NOTICE is for expected messages
* like implicit sequence creation by SERIAL.
* WARNING is for unexpected messages. */

Definition at line 36 of file elog.h.

◆ WARNING_CLIENT_ONLY

#define WARNING_CLIENT_ONLY
Value:
20 /* Warnings to be sent to client as usual, but
* never to the server log. */

Definition at line 38 of file elog.h.

Typedef Documentation

◆ emit_log_hook_type

typedef void(* emit_log_hook_type) (ErrorData *edata)

Definition at line 464 of file elog.h.

◆ ErrorContextCallback

◆ ErrorData

Enumeration Type Documentation

◆ PGErrorVerbosity

Enumerator
PGERROR_TERSE 
PGERROR_DEFAULT 
PGERROR_VERBOSE 

Definition at line 470 of file elog.h.

Function Documentation

◆ check_log_of_query()

bool check_log_of_query ( ErrorData edata)
extern

Definition at line 3178 of file elog.c.

3179{
3180 /* log required? */
3182 return false;
3183
3184 /* query log wanted? */
3185 if (edata->hide_stmt)
3186 return false;
3187
3188 /* query string available? */
3189 if (debug_query_string == NULL)
3190 return false;
3191
3192 return true;
3193}
static bool is_log_level_output(int elevel, int log_min_level)
Definition elog.c:213
int log_min_error_statement
Definition guc_tables.c:549
const char * debug_query_string
Definition postgres.c:90

References debug_query_string, fb(), is_log_level_output(), and log_min_error_statement.

Referenced by send_message_to_server_log(), write_csvlog(), and write_jsonlog().

◆ CopyErrorData()

ErrorData * CopyErrorData ( void  )
extern

Definition at line 1941 of file elog.c.

1942{
1945
1946 /*
1947 * we don't increment recursion_depth because out-of-memory here does not
1948 * indicate a problem within the error subsystem.
1949 */
1951
1953
1954 /* Copy the struct itself */
1956 memcpy(newedata, edata, sizeof(ErrorData));
1957
1958 /*
1959 * Make copies of separately-allocated strings. Note that we copy even
1960 * theoretically-constant strings such as filename. This is because those
1961 * could point into JIT-created code segments that might get unloaded at
1962 * transaction cleanup. In some cases we need the copied ErrorData to
1963 * survive transaction boundaries, so we'd better copy those strings too.
1964 */
1965 if (newedata->filename)
1966 newedata->filename = pstrdup(newedata->filename);
1967 if (newedata->funcname)
1968 newedata->funcname = pstrdup(newedata->funcname);
1969 if (newedata->domain)
1970 newedata->domain = pstrdup(newedata->domain);
1971 if (newedata->context_domain)
1972 newedata->context_domain = pstrdup(newedata->context_domain);
1973 if (newedata->message)
1974 newedata->message = pstrdup(newedata->message);
1975 if (newedata->detail)
1976 newedata->detail = pstrdup(newedata->detail);
1977 if (newedata->detail_log)
1978 newedata->detail_log = pstrdup(newedata->detail_log);
1979 if (newedata->hint)
1980 newedata->hint = pstrdup(newedata->hint);
1981 if (newedata->context)
1982 newedata->context = pstrdup(newedata->context);
1983 if (newedata->backtrace)
1984 newedata->backtrace = pstrdup(newedata->backtrace);
1985 if (newedata->message_id)
1986 newedata->message_id = pstrdup(newedata->message_id);
1987 if (newedata->schema_name)
1988 newedata->schema_name = pstrdup(newedata->schema_name);
1989 if (newedata->table_name)
1990 newedata->table_name = pstrdup(newedata->table_name);
1991 if (newedata->column_name)
1992 newedata->column_name = pstrdup(newedata->column_name);
1993 if (newedata->datatype_name)
1994 newedata->datatype_name = pstrdup(newedata->datatype_name);
1995 if (newedata->constraint_name)
1996 newedata->constraint_name = pstrdup(newedata->constraint_name);
1997 if (newedata->internalquery)
1998 newedata->internalquery = pstrdup(newedata->internalquery);
1999
2000 /* Use the calling context for string allocation */
2001 newedata->assoc_context = CurrentMemoryContext;
2002
2003 return newedata;
2004}
#define Assert(condition)
Definition c.h:885
static int errordata_stack_depth
Definition elog.c:157
#define CHECK_STACK_DEPTH()
Definition elog.c:174
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition elog.c:155
#define palloc_object(type)
Definition fe_memutils.h:74
char * pstrdup(const char *in)
Definition mcxt.c:1781
MemoryContext CurrentMemoryContext
Definition mcxt.c:160
MemoryContext ErrorContext
Definition mcxt.c:167

References Assert, CHECK_STACK_DEPTH, CurrentMemoryContext, ErrorContext, errordata, errordata_stack_depth, fb(), palloc_object, and pstrdup().

Referenced by _SPI_commit(), _SPI_rollback(), exec_stmt_block(), GetConnection(), initTrie(), plperl_return_next(), plperl_spi_commit(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_spi_rollback(), plperl_util_elog(), pltcl_commit(), pltcl_elog(), pltcl_rollback(), pltcl_subtrans_abort(), PLy_commit(), PLy_output(), PLy_rollback(), PLy_spi_subtransaction_abort(), and ReorderBufferProcessTXN().

◆ DebugFileOpen()

void DebugFileOpen ( void  )
extern

Definition at line 2306 of file elog.c.

2307{
2308 int fd,
2309 istty;
2310
2311 if (OutputFileName[0])
2312 {
2313 /*
2314 * A debug-output file name was given.
2315 *
2316 * Make sure we can write the file, and find out if it's a tty.
2317 */
2319 0666)) < 0)
2320 ereport(FATAL,
2322 errmsg("could not open file \"%s\": %m", OutputFileName)));
2323 istty = isatty(fd);
2324 close(fd);
2325
2326 /*
2327 * Redirect our stderr to the debug output file.
2328 */
2329 if (!freopen(OutputFileName, "a", stderr))
2330 ereport(FATAL,
2332 errmsg("could not reopen file \"%s\" as stderr: %m",
2333 OutputFileName)));
2334
2335 /*
2336 * If the file is a tty and we're running under the postmaster, try to
2337 * send stdout there as well (if it isn't a tty then stderr will block
2338 * out stdout, so we may as well let stdout go wherever it was going
2339 * before).
2340 */
2341 if (istty && IsUnderPostmaster)
2342 if (!freopen(OutputFileName, "a", stdout))
2343 ereport(FATAL,
2345 errmsg("could not reopen file \"%s\" as stdout: %m",
2346 OutputFileName)));
2347 }
2348}
int errcode_for_file_access(void)
Definition elog.c:897
int errmsg(const char *fmt,...)
Definition elog.c:1093
#define FATAL
Definition elog.h:41
#define ereport(elevel,...)
Definition elog.h:150
bool IsUnderPostmaster
Definition globals.c:120
char OutputFileName[MAXPGPATH]
Definition globals.c:79
#define close(a)
Definition win32.h:12
static int fd(const char *x, int i)

References close, ereport, errcode_for_file_access(), errmsg(), FATAL, fb(), fd(), IsUnderPostmaster, and OutputFileName.

Referenced by BaseInit().

◆ EmitErrorReport()

void EmitErrorReport ( void  )
extern

Definition at line 1882 of file elog.c.

1883{
1885 MemoryContext oldcontext;
1886
1889 oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1890
1891 /*
1892 * Reset the formatted timestamp fields before emitting any logs. This
1893 * includes all the log destinations and emit_log_hook, as the latter
1894 * could use log_line_prefix or the formatted timestamps.
1895 */
1896 saved_timeval_set = false;
1897 formatted_log_time[0] = '\0';
1898
1899 /*
1900 * Call hook before sending message to log. The hook function is allowed
1901 * to turn off edata->output_to_server, so we must recheck that afterward.
1902 * Making any other change in the content of edata is not considered
1903 * supported.
1904 *
1905 * Note: the reason why the hook can only turn off output_to_server, and
1906 * not turn it on, is that it'd be unreliable: we will never get here at
1907 * all if errstart() deems the message uninteresting. A hook that could
1908 * make decisions in that direction would have to hook into errstart(),
1909 * where it would have much less information available. emit_log_hook is
1910 * intended for custom log filtering and custom log message transmission
1911 * mechanisms.
1912 *
1913 * The log hook has access to both the translated and original English
1914 * error message text, which is passed through to allow it to be used as a
1915 * message identifier. Note that the original text is not available for
1916 * detail, detail_log, hint and context text elements.
1917 */
1918 if (edata->output_to_server && emit_log_hook)
1919 (*emit_log_hook) (edata);
1920
1921 /* Send to server log, if enabled */
1922 if (edata->output_to_server)
1924
1925 /* Send to client, if enabled */
1926 if (edata->output_to_client)
1928
1929 MemoryContextSwitchTo(oldcontext);
1931}
static char formatted_log_time[FORMATTED_TS_LEN]
Definition elog.c:170
static void send_message_to_frontend(ErrorData *edata)
Definition elog.c:3976
static bool saved_timeval_set
Definition elog.c:166
static int recursion_depth
Definition elog.c:159
emit_log_hook_type emit_log_hook
Definition elog.c:110
static void send_message_to_server_log(ErrorData *edata)
Definition elog.c:3673
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition palloc.h:124

References CHECK_STACK_DEPTH, emit_log_hook, errordata, errordata_stack_depth, fb(), formatted_log_time, MemoryContextSwitchTo(), recursion_depth, saved_timeval_set, send_message_to_frontend(), and send_message_to_server_log().

Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), BackgroundWriterMain(), CheckpointerMain(), DisableSubscriptionAndExit(), do_autovacuum(), errfinish(), IoWorkerMain(), perform_work_item(), pgarch_archiveXlog(), PostgresMain(), ReplSlotSyncWorkerMain(), WalSummarizerMain(), and WalWriterMain().

◆ err_generic_string()

◆ errbacktrace()

int errbacktrace ( void  )
extern

Definition at line 1115 of file elog.c.

1116{
1118 MemoryContext oldcontext;
1119
1122 oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1123
1124 set_backtrace(edata, 1);
1125
1126 MemoryContextSwitchTo(oldcontext);
1128
1129 return 0;
1130}
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip)
Definition elog.c:1146

References CHECK_STACK_DEPTH, errordata, errordata_stack_depth, fb(), MemoryContextSwitchTo(), recursion_depth, and set_backtrace().

◆ errcode()

int errcode ( int  sqlerrcode)
extern

Definition at line 874 of file elog.c.

875{
877
878 /* we don't bother incrementing recursion_depth */
880
881 edata->sqlerrcode = sqlerrcode;
882
883 return 0; /* return value does not matter */
884}

References CHECK_STACK_DEPTH, errordata, errordata_stack_depth, and fb().

Referenced by _arrq_cons(), _bt_binsrch_insert(), _bt_check_third_page(), _bt_check_unique(), _bt_checkpage(), _bt_get_endpoint(), _bt_getmeta(), _bt_gettrueroot(), _bt_insert_parent(), _bt_insertonpg(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_preprocess_array_keys_final(), _bt_split(), _bt_unlink_halfdead_page(), _crypt_blowfish_rn(), _crypt_gensalt_sha(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_first(), _hash_init(), _hash_ovflblkno_to_bitno(), _intbig_in(), _intbig_out(), _lca(), _lt_q_regex(), _ltree_compress(), _PG_init(), _SPI_commit(), _SPI_execute_plan(), _SPI_rollback(), _tarWriteHeader(), AbortBufferIO(), accumArrayResult(), accumArrayResultArr(), aclcheck_error(), aclcheck_error_col(), aclinsert(), aclitemin(), aclparse(), aclremove(), add_guc_variable(), add_json(), add_jsonb(), add_parameter_name(), add_reloption_kind(), add_size(), addCompoundAffixFlagValue(), AddEnumLabel(), addFamilyMember(), addFkConstraint(), addFkRecurseReferencing(), AddQual(), addRangeTableEntryForCTE(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForSubquery(), addRangeTableEntryForTableFunc(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRelationNotNullConstraints(), AddRoleMems(), addTargetToSortList(), addUnicode(), addUnicodeChar(), AdjustIntervalForTypmod(), AdjustNotNullInheritance(), AdjustTimestampForTypmod(), advance_windowaggregate(), afterTriggerMarkEvents(), AfterTriggerSetState(), AggregateCreate(), alen_object_start(), alen_scalar(), AllocateDir(), AllocateFile(), AllocateVfd(), AllocSetContextCreateInternal(), AlterDatabase(), AlterDatabaseOwner(), AlterDatabaseRefreshColl(), AlterDomainDropConstraint(), AlterDomainValidateConstraint(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_internal(), AlterEventTriggerOwner_oid(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_internal(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectRename_internal(), AlterOperator(), AlterOpFamily(), AlterOpFamilyAdd(), AlterOpFamilyDrop(), AlterPolicy(), AlterPublication(), AlterPublicationOptions(), AlterPublicationOwner(), AlterPublicationOwner_internal(), AlterPublicationOwner_oid(), AlterPublicationSchemas(), AlterRelationNamespaceInternal(), AlterReplicationSlot(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterStatistics(), AlterSubscription(), AlterSubscription_refresh(), AlterSubscription_refresh_seq(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), AlterSubscriptionOwner_oid(), AlterSystemSetConfigFile(), AlterTableMoveAll(), AlterTableNamespace(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterType(), AlterTypeNamespace(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterTypeOwnerInternal(), AlterUserMapping(), amcheck_index_mainfork_expected(), amcheck_lock_relation_and_check(), analyzeCTE(), analyzeCTETargetList(), anybit_typmodin(), anychar_typmodin(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_begin_prepare(), apply_handle_commit(), apply_handle_origin(), apply_handle_prepare(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), apply_typmod(), apply_typmod_special(), ApplyRetrieveRule(), apw_start_database_worker(), apw_start_leader_worker(), array_agg_array_combine(), array_agg_array_transfn(), array_agg_deserialize(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), array_exec_setup(), array_fill(), array_fill_internal(), array_fill_with_lower_bounds(), array_get_slice(), array_in(), array_iterator(), array_map(), array_position_common(), array_positions(), array_prepend(), array_recv(), array_replace_internal(), array_sample(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_sort_internal(), array_subscript_check_subscripts(), array_subscript_transform(), array_to_datum_internal(), array_to_tsvector(), ArrayCheckBoundsSafe(), ArrayGetIntegerTypmods(), ArrayGetNItemsSafe(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_collations_walker(), assign_hypothetical_collations(), assign_record_type_identifier(), assignable_custom_variable_name(), assignOperTypes(), assignProcTypes(), AssignTransactionId(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), Async_Notify(), ATAddCheckNNConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDetachPartition(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecMergePartitions(), ATExecReplicaIdentity(), ATExecSetCompression(), ATExecSetExpression(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSplitPartition(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepCmd(), ATPrepDropColumn(), ATPrepDropExpression(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), AttachPartitionEnsureIndexes(), attribute_statistics_update(), auth_failed(), auth_peer(), autoinc(), autoprewarm_database_main(), autoprewarm_start_worker(), BackendInitialize(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BaseBackupGetTargetHandle(), BasicOpenFilePerm(), bbsink_gzip_new(), bbsink_lz4_new(), bbsink_server_archive_contents(), bbsink_server_manifest_contents(), bbsink_server_new(), bbsink_zstd_new(), be_lo_close(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), before_shmem_exit(), begin_prepare_cb_wrapper(), BeginCopyFrom(), BeginCopyTo(), BeginTransactionBlock(), bernoulli_beginsamplescan(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), bloom_get_procinfo(), blvalidate(), boolin(), BootstrapModeMain(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_bloom_summary_in(), brin_bloom_summary_recv(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_minmax_multi_summary_in(), brin_minmax_multi_summary_recv(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brinGetTupleForHeapBlock(), brininsert(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_entry_unique_check(), bt_index_block_validate(), bt_index_check_callback(), bt_leftmost_ignoring_half_dead(), bt_metap(), bt_multi_page_stats(), bt_normalize_tuple(), bt_page_items_bytea(), bt_page_items_internal(), bt_page_stats_internal(), bt_recheck_sibling_links(), bt_report_duplicate(), bt_right_page_check_scankey(), bt_target_page_check(), bt_tuple_present_callback(), BTreeTupleGetHeapTIDCareful(), btvacuumpage(), btvalidate(), buffer_readv_report(), build_attrmap_by_name(), build_attrmap_by_position(), build_column_default(), build_datatype(), build_mvdependencies(), build_mvndistinct(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), builtin_locale_encoding(), builtin_validate_locale(), BumpContextCreate(), bytea_int2(), bytea_int4(), bytea_int8(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaout(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), calculate_frame_offsets(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), cannotCastJsonbValue(), cash_dist(), cash_div_cash(), cash_div_float8(), cash_div_int64(), cash_in(), cash_mi_cash(), cash_mul_float8(), cash_mul_int64(), cash_pl_cash(), CastCreate(), cfunc_resolve_polymorphic_argtypes(), changeDependenciesOn(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_agglevels_and_constraints(), check_and_init_gencol(), check_and_set_sync_info(), check_av_worker_gucs(), check_can_set_role(), check_circularity(), check_collation_set(), check_collation_set(), check_conn_params(), check_default_partition_contents(), check_default_table_access_method(), check_default_tablespace(), check_default_text_search_config(), check_duplicates_in_publist(), check_enable_rls(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_for_column_name_collision(), check_foreign_key(), check_ident_usermap(), check_index_is_clusterable(), check_index_page(), check_lateral_ref_ok(), check_locale(), check_mcvlist_array(), check_nested_generated_walker(), check_new_partition_bound(), check_oauth_validator(), check_object_ownership(), check_of_type(), check_parameter_resolution_walker(), check_parent_values_in_new_partitions(), check_partition_bounds_for_split_list(), check_partition_bounds_for_split_range(), check_partitions_not_overlap_list(), check_password(), check_primary_key(), check_pub_dead_tuple_retention(), check_publication_add_relation(), check_publication_add_schema(), check_publications(), check_publications_origin_sequences(), check_publications_origin_tables(), check_relation_block_range(), check_relation_privileges(), check_relation_relkind(), check_relation_updatable(), check_restricted_library_name(), check_role(), check_role_grantor(), check_role_membership_authorization(), check_rolespec_name(), check_safe_enum_use(), check_session_authorization(), check_simple_rowfilter_expr_walker(), check_sql_fn_statement(), check_sql_stmt_retval(), check_srf_call_placement(), check_ssl_key_file_permissions(), check_stack_depth(), check_temp_tablespaces(), check_transform_function(), check_two_partitions_bounds_range(), check_unicode_value(), check_valid_extension_name(), check_valid_int2vector(), check_valid_oidvector(), check_valid_version_name(), check_virtual_generated_security_walker(), CheckAlterPublication(), CheckAlterSubOption(), CheckAlterTableIsSafe(), CheckAndGetDbnameFromConninfo(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), CheckDuplicateColumnOrPathNames(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), CheckForSessionAndXactLocks(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), checkJsonOutputFormat(), CheckLogicalDecodingRequirements(), checkMembershipInCurrentExtension(), CheckMyDatabase(), checkNameSpaceConflicts(), checkPartition(), CheckPredicate(), CheckPubRelationColumnList(), CheckRecoveryConflictDeadlock(), CheckRelationTableSpaceMove(), CheckRequiredParameterValues(), CheckRestrictedOperation(), checkRuleResultList(), CheckSASLAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotPermissions(), CheckSlotRequirements(), checkStringLen(), CheckSubDeadTupleRetention(), CheckSubscriptionRelkind(), CheckTableNotInUse(), CheckTablespaceDirectory(), checkTargetlistEntrySQL92(), checkTimezoneIsUsedForCast(), CheckTransactionBlock(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewColumns(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), ClientAuthentication(), CloneFkReferencing(), ClosePipeFromProgram(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), coerceJsonFuncExpr(), CollationCreate(), collectMatchBitmap(), colNameToVar(), CommandCounterIncrement(), CommentObject(), commit_prepared_cb_wrapper(), comparetup_index_btree_tiebreak(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_common_attribute(), compute_function_attributes(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), connect_pg_server(), connectby_text(), connectby_text_serial(), ConstraintSetParentConstraint(), construct_md_array(), ConversionCreate(), convert_and_check_filename(), convert_any_priv_string(), convert_column_name(), convert_function_name(), convert_type_name(), convertJsonbArray(), convertJsonbObject(), cookConstraint(), cookDefault(), copy_replication_slot(), copy_sequences(), copy_table(), CopyFrom(), CopyFromBinaryOneRow(), CopyFromTextLikeOneRow(), CopyGetAttnums(), CopyGetData(), CopyReadAttributesCSV(), CopyReadAttributesText(), CopyReadBinaryAttribute(), CopyReadLineText(), CopyXLogRecordToWAL(), countVariablesFromJsonb(), create_ctas_nodata(), create_distinct_paths(), create_ordinary_grouping_paths(), create_pg_locale_icu(), create_tablespace_directories(), CreateAccessMethod(), CreateCast(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), createPartitionTable(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateSubscription(), CreateTableAsRelExists(), CreateTableSpace(), CreateTransform(), CreateTriggerFiringOn(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_coord(), cube_coord_llur(), cube_recv(), cube_subset(), cube_yyerror(), currtid_for_view(), currtid_internal(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dacosh(), dasin(), dasind(), datanh(), date2timestamp_safe(), date2timestamptz_safe(), date_in(), date_mi(), date_mii(), date_pli(), date_random(), date_recv(), daterange_canonical(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json_internal(), datum_to_jsonb_internal(), datumGetSize(), db_encoding_convert(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_conn_not_avail(), dblink_connect(), dblink_connstr_check(), dblink_exec(), dblink_fdw_validator(), dblink_fetch(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DCH_from_char(), DCH_to_char(), dcos(), dcosd(), dcot(), dcotd(), DeadLockReport(), DecodeTimezoneName(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetCopyHeaderOption(), defGetCopyLogVerbosityChoice(), defGetCopyOnErrorChoice(), defGetCopyRejectLimitOption(), defGetGeneratedColsOption(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetObjectId(), defGetQualifiedName(), defGetStreamingMode(), defGetString(), defGetStringList(), defGetTypeLength(), defGetTypeName(), define_custom_variable(), DefineAggregate(), DefineCollation(), DefineCompositeType(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineSavepoint(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DefineType(), DefineView(), DefineVirtualRelation(), deleteConnection(), DeleteInheritsTuple(), dependencies_array_element_start(), dependencies_array_end(), dependencies_array_start(), dependencies_object_end(), dependencies_object_field_start(), dependencies_object_start(), dependencies_scalar(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), div_var(), div_var_int(), dlog1(), dlog10(), do_analyze_rel(), do_pg_backup_start(), do_pg_backup_stop(), do_to_timestamp(), DoCopy(), domain_check_input(), domain_state_setup(), domainAddCheckConstraint(), domainAddNotNullConstraint(), DoPortalRewind(), dpow(), DropConfigurationMapping(), dropconstraint_internal(), DropDatabase(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dsa_get_total_size_from_handle(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_create(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker_jsonb(), ean2isn(), ean2string(), elements_object_start(), elements_scalar(), elements_worker_jsonb(), emit_audit_message(), EnableDisableRule(), EnableDisableTrigger(), EnableLockPagesPrivilege(), encrypt_password(), EndPrepare(), EndTransactionBlock(), enforce_generic_type_consistency(), enlarge_trgm_array(), enlargeStringInfo(), entry_reset(), enum_cmp_internal(), enum_first(), enum_in(), enum_last(), enum_out(), enum_range_all(), enum_range_bounds(), enum_recv(), enum_send(), EnumValuesCreate(), errcode_apply_conflict(), errcode_for_dynamic_shared_memory(), errno_from_string(), error_commit_ts_disabled(), error_duplicate_filter_variable(), error_multiple_recovery_targets(), error_view_not_updatable(), errorConflictingDefElem(), errorMissingColumn(), errorMissingRTE(), esc_dec_len(), esc_decode(), EvalPlanQualFetchRowMark(), evaluateGeneratedExpressionsAndCheckConstraints(), EvaluateParams(), exec_assign_value(), exec_bind_message(), exec_check_assignable(), exec_describe_portal_message(), exec_describe_statement_message(), exec_dynquery_with_params(), exec_eval_datum(), exec_eval_expr(), exec_execute_message(), exec_init_tuple_store(), exec_move_row_from_fields(), exec_object_restorecon(), exec_parse_message(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_case(), exec_stmt_close(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsRecurse(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecARDeleteTriggers(), ExecARInsertTriggers(), ExecARUpdateTriggers(), ExecBRInsertTriggers(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecBuildUpdateProjection(), ExecCallTriggerFunc(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecCheckpoint(), ExecCheckTupleVisible(), ExecConstraints(), ExecCrossPartitionUpdate(), ExecCrossPartitionUpdateForeignKey(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalJsonCoercionFinish(), ExecEvalJsonExprPath(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language_check(), ExecGrant_Relation(), ExecGrant_Type_check(), ExecInitAgg(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInitSubscriptingRef(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecMergeMatched(), ExecOnConflictLockRow(), ExecOpenScanRelation(), ExecPartitionCheckEmitError(), ExecPrepareTuplestoreResult(), ExecReindex(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), executeBinaryArithmExpr(), ExecuteCallStmt(), executeDateTimeMethod(), ExecuteDoStmt(), ExecuteGrantStmt(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), ExecuteQuery(), ExecuteTruncate(), executeUnaryArithmExpr(), ExecVacuum(), ExecWaitStmt(), ExecWithCheckOptions(), ExecWithoutOverlapsNotEmpty(), ExitPostmaster(), exp_var(), expand_col_privileges(), expand_vacuum_rel(), ExpandAllTables(), ExpandColumnRefStar(), expandTableLikeClause(), ExportSnapshot(), exprType(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), extended_statistics_update(), extract_date(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fatal_llvm_error_handler(), fatal_llvm_new_handler(), fatal_system_new_handler(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), fetch_relation_list(), fetch_remote_table_info(), FetchPreparedStatement(), file_fdw_validator(), fileIterateForeignScan(), FileWriteV(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_path(), find_in_paths(), find_my_exec(), find_option(), find_provider(), find_typed_table_dependencies(), FindDeletedTupleInLocalRel(), findDependentObjects(), FindFKPeriodOpers(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeSubscriptingFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), finish_nodeitem(), finite_interval_mi(), finite_interval_pl(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), flattenJsonPathParseItem(), float4in_internal(), float8_timestamptz(), float8in_internal(), float_overflow_error(), float_underflow_error(), float_zero_divide_error(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), forkname_to_number(), free_parsestate(), FreezeMultiXactId(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), fsm_page_contents(), ftoi2(), ftoi4(), ftoi8(), func_select_candidate(), g_cube_distance(), g_int_compress(), g_int_decompress(), gai_strerror(), gbtreekey_in(), gbtreekey_out(), gen_random_uuid(), generate_error_response(), generate_nonunion_paths(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz_internal(), generate_uuidv7(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), GenericMatchText(), get_am_type_oid(), get_cached_rowtype(), get_cast_oid(), get_collation_actual_version_builtin(), get_collation_oid(), get_connect_string(), get_controlfile_by_exact_path(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_fn_opclass_options(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_language_oid(), get_multirange_io_data(), get_namespace_oid(), get_object_address(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_publication_rel(), get_object_address_publication_schema(), get_object_address_relobject(), get_object_address_type(), get_object_address_usermapping(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page_1_9(), get_raw_page_fork_1_9(), get_raw_page_internal(), get_record_type_from_argument(), get_record_type_from_query(), get_relation_by_qualified_name(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_required_extension(), get_rewrite_oid(), get_role_oid(), get_rolespec_oid(), get_rolespec_tuple(), get_rte_attribute_is_dropped(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), get_tablespace_location(), get_tablespace_oid(), get_th(), get_transform_oid(), get_trigger_oid(), get_ts_config_oid(), get_ts_dict_oid(), get_ts_parser_func(), get_ts_parser_oid(), get_ts_template_func(), get_ts_template_oid(), get_tsearch_config_filename(), get_tuple_of_interest(), get_windowfunc_expr_helper(), getAffixFlagSet(), getArrayIndex(), GetAttributeCompression(), GetAttributeStorage(), GetColumnDefCollation(), GetConfFilesInDir(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), GetCurrentCommandId(), GetCurrentTimeUsec(), getdatafield(), GetDefaultOpClass(), GetDefaultTablespace(), GetExtensibleNodeEntry(), GetFdwRoutine(), GetFdwRoutineByServerId(), GetFileBackupMethod(), getid(), GetIndexAmRoutineByAmId(), getJsonPathVariable(), GetLocalVictimBuffer(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetOldestUnsummarizedLSN(), GetOperatorFromCompareType(), GetRunningTransactionData(), GetSafeSnapshot(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), gettoken_query(), gettoken_query_standard(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), GetWALBlockInfo(), getWeights(), ghstore_in(), ghstore_out(), gin_check_parent_keys_consistency(), gin_check_posting_tree_parent_keys_consistency(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginadjustmembers(), GinBufferInit(), ginCombineData(), GinFormTuple(), ginNewScanKey(), ginvalidate(), gist_page_items(), gist_page_items_bytea(), gist_page_opaque_info(), gistadjustmembers(), gistcheckpage(), gistSplit(), gistUserPicksplit(), gistvalidate(), GrantRole(), grouping_planner(), gtrgm_in(), gtrgm_out(), gtsvectorin(), guc_malloc(), guc_realloc(), handle_streamed_transaction(), HandleConcurrentAbort(), HandleFunctionRequest(), HandleUploadManifestPacket(), has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), hash_array(), hash_array_extended(), hash_array_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_multirange(), hash_multirange_extended(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_record(), hash_record_extended(), hash_scalar(), hash_search_with_hash_value(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), hashvalidate(), heap_acquire_tuplock(), heap_beginscan(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_fetch_toast_slice(), heap_force_common(), heap_form_minimal_tuple(), heap_form_tuple(), heap_getnext(), heap_inplace_lock(), heap_lock_tuple(), heap_page_items(), heap_pre_freeze_checks(), heap_prepare_freeze_tuple(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_tuple_infomask_flags(), heap_update(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_tuple_lock(), hex_decode_safe_scalar(), hlparsetext(), HoldPinnedPortals(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_subscript_assign(), hstore_subscript_transform(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckKeyLength(), hstoreCheckValLen(), hstoreCheckValLength(), i4tochar(), i4toi2(), i8tooid(), icu_language_tag(), icu_validate_locale(), identify_and_fix_vm_corruption(), identify_update_path(), import_mcv(), ImportForeignSchema(), ImportSnapshot(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), inclusion_get_procinfo(), index_beginscan(), index_check_primary_key(), index_checkable(), index_concurrently_create_copy(), index_constraint_create(), index_create(), index_delete_check_htid(), index_drop(), index_form_tuple_context(), index_opclass_options(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sexpr(), init_trgm_array(), initArrayResultArr(), InitControlFile(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeMaxBackends(), InitializeSessionUserId(), InitLocalBuffers(), InitMaterializedSRF(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitShmemAllocator(), InitTempTableNamespace(), initTrie(), InitWalRecovery(), InitXLogReaderState(), inner_subltree(), insert_username(), InsertRule(), instantiate_empty_record_variable(), int24div(), int24mi(), int24mul(), int24pl(), int28div(), int28mi(), int28mul(), int28pl(), int2_dist(), int2abs(), int2div(), int2mi(), int2mod(), int2mul(), int2pl(), int2um(), int2vectorin(), int2vectorrecv(), int42div(), int42mi(), int42mul(), int42pl(), int48div(), int48mi(), int48mul(), int48pl(), int4_dist(), int4abs(), int4div(), int4gcd_internal(), int4inc(), int4lcm(), int4mi(), int4mod(), int4mul(), int4pl(), int4range_canonical(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8gcd_internal(), int8inc(), int8lcm(), int8mi(), int8mod(), int8mul(), int8pl(), int8range_canonical(), int8um(), internal_get_result_type(), internal_inetpl(), internal_load_library(), interpret_AS_clause(), interpret_func_parallel(), interpret_func_support(), interpret_function_parameter_list(), interval_avg(), interval_div(), interval_in(), interval_justify_days(), interval_justify_hours(), interval_justify_interval(), interval_mi(), interval_mul(), interval_part_common(), interval_pl(), interval_sum(), interval_time(), interval_trunc(), interval_um_internal(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), issue_xlog_fsync(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), json_agg_transfn_worker(), json_build_object_worker(), json_errsave_error(), json_object(), json_object_agg_transfn_worker(), json_object_two_arg(), json_validate(), jsonb_agg_transfn_worker(), jsonb_array_length(), jsonb_build_object_worker(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn_worker(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_path_match_internal(), jsonb_set(), jsonb_set_lax(), jsonb_subscript_check_subscripts(), jsonb_subscript_transform(), JsonEncodeDateTime(), JsonItemFromDatum(), jsonpath_yyerror(), jsonPathFromCstring(), JsonPathQuery(), JsonPathValue(), JsValueToJsObject(), LargeObjectDrop(), lastval(), length_in_encoding(), libpqrcv_alter_slot(), libpqrcv_check_conninfo(), libpqrcv_connect(), libpqrcv_create_slot(), libpqrcv_endstreaming(), libpqrcv_exec(), libpqrcv_get_conninfo(), libpqrcv_get_option_from_conninfo(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), libpqrcv_receive(), libpqrcv_send(), libpqrcv_startstreaming(), libpqsrv_connect_prepare(), libpqsrv_PQwrap(), like_fixed_prefix_ci(), line_construct_pp(), line_decode(), line_in(), line_recv(), ln_var(), lo_get_fragment_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_critical_index(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_libraries(), LoadArchiveLibrary(), LoadPublications(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockSchemaList(), LockTableRecurse(), LockViewRecurse_walker(), LogicalParallelApplyLoop(), logicalrep_rel_mark_updatable(), logicalrep_rel_open(), logicalrep_report_missing_or_gen_attrs(), logicalrep_worker_attach(), logicalrep_worker_launch(), LogicalRepApplyLoop(), LogicalRepSyncSequences(), LogicalRepSyncTableStart(), lookup_agg_function(), lookup_am_handler_func(), lookup_fdw_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeNameExtended(), LookupTypeNameOid(), lpad(), lt_q_regex(), ltree_concat(), ltree_gist_in(), ltree_gist_out(), ltree_gist_relopts_validator(), ltree_to_plpython(), ltxtq_out(), ltxtq_send(), LWLockNewTrancheId(), lz4_decompress_datum(), lz4_decompress_datum_slice(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), make_absolute_path(), make_callstmt_target(), make_date(), make_distinct_op(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), make_inh_translation_list(), make_interval(), make_libc_collator(), make_modifytable(), make_op(), make_outerjoininfo(), make_pathkeys_for_window(), make_result_safe(), make_row_comparison_op(), make_row_distinct_op(), make_ruledef(), make_scalar_array_op(), make_time(), make_timestamp_internal(), make_timestamptz_at_timezone(), make_tsvector(), makeMultirangeTypeName(), makepol(), makepol(), makepol(), makeRangeVarFromNameList(), makeWholeRowVar(), map_sql_value_to_xml_value(), mark_index_clustered(), MarkAsPreparing(), MarkGUCPrefixReserved(), MarkInheritDetached(), MarkPortalActive(), matchLocks(), MatchText(), materializeResult(), md5_bytea(), md5_text(), md_readv_report(), mdextend(), mdreadv(), mdzeroextend(), MemoryContextAllocationFailure(), merge_acl_with_grant(), merge_collation_state(), merge_publications(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeChildAttribute(), MergeConstraintsIntoExisting(), MergeInheritedAttribute(), MergeWithExistingConstraint(), metaphone(), minmax_multi_get_procinfo(), moddatetime(), movedb(), mul_size(), multirange_constructor2(), multirange_in(), namerecv(), NamespaceCreate(), ndistinct_array_element_start(), ndistinct_array_end(), ndistinct_array_start(), ndistinct_object_end(), ndistinct_object_field_start(), ndistinct_object_start(), ndistinct_scalar(), network_host(), network_in(), network_out(), network_recv(), network_show(), NextCopyFromRawFieldsInternal(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), NonFiniteIntervalPart(), NonFiniteTimestampTzPart(), normal_rand(), NUM_processor(), NUMDesc_prepare(), numeric_div_safe(), numeric_div_trunc(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4_safe(), numeric_int8_safe(), numeric_ln(), numeric_log(), numeric_mod_safe(), numeric_pg_lsn(), numeric_power(), numeric_recv(), numeric_sqrt(), numerictypmodin(), numericvar_to_double_no_overflow(), oauth_exchange(), oauth_init(), ObjectsInPublicationToOids(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), on_proc_exit(), on_shmem_exit(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTableList(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OperatorUpd(), OperatorValidateParams(), OpFamilyCacheLookup(), optionListToArray(), pa_send_data(), pa_wait_for_xact_finish(), page_checksum_internal(), page_header(), PageAddItemExtended(), PageGetItemIdCareful(), PageGetItemIdCareful(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageIsVerified(), PageRepairFragmentation(), pair_decode(), palloc_btree_page(), ParallelApplyWorkerMain(), ParallelWorkerMain(), ParameterAclLookup(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_datetime(), parse_extension_control_file(), parse_fcall_arguments(), parse_format(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_jsonb_index_flags(), parse_key_value_arrays(), parse_kvpairs_for_auth(), parse_lquery(), parse_ltree(), parse_one_reloption(), parse_output_parameters(), parse_phrase_operator(), parse_publication_options(), parse_re_flags(), parse_sane_timezone(), parse_snapshot(), parse_subscription_options(), parse_test_flags(), parse_tsquery(), parseCheckAggregates(), ParseConfigFile(), ParseConfigFp(), parseCreateReplSlotOptions(), ParseExplainOptionList(), ParseFuncOrColumn(), parseIntFromText(), parseNameAndArgTypes(), parseRelOptionsInternal(), parserOpenTable(), parsetext(), parseTypeString(), parseUnicode(), parseVxidFromText(), parseXidFromText(), partitioned_table_reloptions(), path_add(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFilePerm(), pclose_check(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), PerformWalRecovery(), pg_analyze_and_rewrite_varparams(), pg_any_to_server(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_backup_start(), pg_backup_stop(), pg_base64_decode_internal(), pg_be_scram_build_secret(), pg_buffercache_evict_relation(), pg_buffercache_mark_dirty_relation(), pg_buffercache_superuser_check(), pg_cancel_backend(), pg_class_aclmask_ext(), pg_clear_attribute_stats(), pg_clear_extended_stats(), pg_collation_actual_version(), pg_collation_for(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_cryptohash_create(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_database_collation_actual_version(), pg_database_size_oid(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_error_on_null(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_expr_worker(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_multixact_stats(), pg_get_object_address(), pg_get_serial_sequence(), pg_get_wal_record_info(), pg_get_wal_records_info_till_end_of_wal(), pg_get_wal_replay_pause_state(), pg_get_wal_stats_till_end_of_wal(), pg_hmac_create(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_largeobject_aclmask_snapshot(), pg_log_standby_snapshot(), pg_logical_slot_get_changes_guts(), pg_ls_replslotdir(), pg_ls_tmpdir(), pg_lsn_in_safe(), pg_lsn_mii(), pg_lsn_pli(), pg_mcv_list_in(), pg_mcv_list_recv(), pg_namespace_aclmask_ext(), pg_ndistinct_in(), pg_ndistinct_recv(), pg_nextoid(), pg_parameter_acl_aclmask(), pg_prewarm(), pg_promote(), pg_random_bytes(), pg_read_binary_file_common(), pg_read_file_common(), pg_regerror(), pg_relpages(), pg_relpages_impl(), pg_relpagesbyid(), pg_replication_origin_create(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_replication_slot_advance(), pg_sequence_parameters(), pg_set_regex_collation(), pg_size_bytes(), pg_snapshot_recv(), pg_split_walfile_name(), pg_stat_get_progress_info(), pg_stat_reset_shared(), pg_stat_reset_subscription_stats(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_stats_ext_mcvlist_items(), pg_stop_making_pinned_objects(), pg_strtoint16_safe(), pg_strtoint32_safe(), pg_strtoint64_safe(), pg_switch_wal(), pg_sync_replication_slots(), pg_tablespace_size_oid(), pg_terminate_backend(), pg_to_ascii(), pg_type_aclmask_ext(), pg_unicode_to_server(), pg_visibility(), pg_visibility_map(), pg_wait_until_termination(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_wal_summary_contents(), pg_walfile_name(), pg_walfile_name_offset(), pgfdw_cancel_query_begin(), pgfdw_cancel_query_end(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_internal(), pgfdw_security_check(), pgfdw_xact_callback(), PGLC_localeconv(), pglz_decompress_datum(), pglz_decompress_datum_slice(), pgoutput_column_list_init(), pgoutput_startup(), pgrowlocks(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_get_entry_ref(), pgstat_get_kind_from_str(), pgstat_heap(), pgstat_init_function_usage(), pgstat_relation(), pgstat_reset_replslot(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), pipe_read_line(), placeChar(), plan_recursive_revoke(), plperl_array_to_datum(), plperl_build_tuple_result(), plperl_call_perl_event_trigger_func(), plperl_call_perl_func(), plperl_call_perl_trigger_func(), plperl_create_sub(), plperl_func_handler(), plperl_init_interp(), plperl_modify_tuple(), plperl_return_next_internal(), plperl_spi_execute_fetch_result(), plperl_sv_to_datum(), plperl_sv_to_literal(), plperl_to_hstore(), plperl_trigger_handler(), plperl_trusted_init(), plperl_untrusted_init(), plperl_validator(), plpgsql_build_datatype_arrayof(), plpgsql_build_variable(), plpgsql_compile_callback(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_exec_trigger(), plpgsql_param_eval_generic(), plpgsql_param_eval_generic_ro(), plpgsql_param_eval_recfield(), plpgsql_parse_cwordrowtype(), plpgsql_parse_cwordtype(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_parse_wordtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_validator(), plpgsql_yyerror(), plpython_to_hstore(), pltcl_build_tuple_result(), pltcl_elog(), pltcl_func_handler(), pltcl_trigger_handler(), PLy_cursor_fetch(), PLy_elog_impl(), PLy_exec_function(), PLy_exec_trigger(), PLy_modify_tuple(), PLy_output(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLyObject_AsString(), PLyObject_ToJsonbValue(), PLySequence_ToArray(), PLySequence_ToArray_recurse(), PLySequence_ToComposite(), PLyUnicode_ToComposite(), policy_role_list_to_array(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_validator(), postgresAcquireSampleRowsFunc(), postgresBeginForeignInsert(), postgresExecForeignTruncate(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostgresSingleUserMain(), PostmasterMain(), PostPrepare_Locks(), power_var(), power_var_int(), pq_copymsgbytes(), pq_getmessage(), pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgrawstring(), pq_getmsgstring(), pq_getmsgtext(), pq_startmsgread(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), PreCommit_Portals(), predicatelock_twophase_recover(), PrefetchBuffer(), prepare_cb_wrapper(), prepare_sql_fn_parse_info(), PrepareForIncrementalBackup(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventInTransactionBlock(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_function_rte_ref(), process_matched_tle(), process_owned_by(), process_postgres_switches(), ProcessCancelRequestPacket(), ProcessConfigFileInternal(), ProcessCopyOptions(), ProcessInterrupts(), ProcessParallelApplyMessage(), ProcessParallelApplyMessages(), ProcessParallelMessages(), ProcessPgArchInterrupts(), ProcessRepliesIfAny(), ProcessSlotSyncInterrupts(), ProcessSSLStartup(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), prsd_headline(), prseof(), prssyntaxerror(), prssyntaxerror(), pub_collist_validate(), publication_add_relation(), publication_add_schema(), PublicationDropSchemas(), PublicationDropTables(), pushquery(), PushTransaction(), pushval_asis(), pushValue(), pushValue_internal(), pvsnprintf(), px_crypt_des(), px_crypt_shacrypt(), px_THROW_ERROR(), qtext_load_file(), QTN2QT(), QualifiedNameGetCreationNamespace(), query_to_xml_internal(), queryin(), QueueCheckConstraintValidation(), QueueNNConstraintValidation(), quickdie(), random_numeric(), random_var(), range_constructor3(), range_minus_internal(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackForStats(), RangeVarCallbackMaintainsTable(), RangeVarCallbackOwnsRelation(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), raw_heap_insert(), RE_compile(), RE_compile_and_cache(), RE_wchar_execute(), read_any_attr(), read_attr_value(), read_backup_label(), read_binary_file(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_objtype_from_string(), read_relmap_file(), read_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayDimensions(), ReadArrayStr(), ReadArrayToken(), ReadBufferExtended(), ReadControlFile(), ReadDimensionInt(), readRecoverySignalFile(), ReadReplicationSlot(), readstoplist(), ReadTwoPhaseFile(), ReassignOwnedObjects(), ReceiveCopyBinaryHeader(), recompute_limits(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), recordDependencyOnCurrentExtension(), RecoveryRequiresIntParameter(), recursive_revoke(), recv_password_packet(), refresh_by_match_merge(), RefreshMatViewByOid(), refuseDupeIndexAttach(), regclassin(), regcollationin(), regcomp_auth_token(), regconfigin(), regdatabasein(), regdictionaryin(), regex_fixed_prefix(), regexp_count(), regexp_fixed_prefix(), regexp_instr(), regexp_like(), regexp_match(), regexp_split_to_array(), regexp_split_to_table(), regexp_substr(), RegisterBackgroundWorker(), RegisterExtensibleNodeEntry(), RegisterTimeout(), regnamespacein(), regoperatorin(), regoperin(), regprocedurein(), regprocin(), REGRESS_exec_check_perms(), REGRESS_object_access_hook(), REGRESS_object_access_hook_str(), REGRESS_utility_command(), regrolein(), reindex_index(), reindex_relation(), ReindexMultipleTables(), ReindexRelationConcurrently(), reject_target_detail(), relation_statistics_update(), RelationBuildPartitionKey(), RelationCacheInitializePhase3(), RelationCopyStorage(), RelationGetBufferForTuple(), RelationSetNewRelfilenumber(), ReleaseOneSerializableXact(), ReleaseSavepoint(), RememberAllDependentForRebuilding(), remove_tablespace_symlink(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePolicyById(), RemoveRelations(), RemoveRewriteRuleById(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveUserMapping(), rename_constraint_internal(), rename_policy(), renameatt_check(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), renametrig_internal(), RenameType(), RenameTypeInternal(), repeat(), replace_percent_placeholders(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarFromTargetList(), replication_yyerror(), ReplicationSlotAcquire(), ReplicationSlotAlter(), ReplicationSlotCreate(), ReplicationSlotDrop(), ReplicationSlotDropAtPubNode(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_session_reset(), replorigin_session_setup(), replorigin_state_clear(), ReplSlotSyncWorkerMain(), report_invalid_encoding_int(), report_name_conflict(), report_namespace_conflict(), report_newlocale_failure(), report_recovery_conflict(), report_sequence_errors(), report_untranslatable_char(), reportDependentObjects(), ReportNotNullViolationError(), ReportSlotConnectionError(), ReportWalSummaryError(), RequestNamedLWLockTranche(), reserveAllocatedDesc(), resolve_anyarray_from_others(), resolve_anyelement_from_others(), resolve_anymultirange_from_others(), resolve_anyrange_from_others(), resolve_column_ref(), resolve_unique_index_expr(), ResolveOpClass(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), revalidate_rectypeid(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteSearchAndCycle(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_check(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), rollback_prepared_cb_wrapper(), RollbackToSavepoint(), rpad(), run_apply_worker(), sanity_check_array(), sanity_check_tid_array(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanner_yyerror(), scanNSItemForColumn(), scanRTEForColumn(), scram_exchange(), scram_init(), secure_open_gssapi(), secure_read(), secure_write(), seg_yyerror(), select_common_collation(), select_common_type(), select_common_type_from_oids(), select_perl_context(), SendBaseBackup(), sendDir(), SendFunctionResult(), SendTimeLineHistory(), sepgsql_attribute_relabel(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_client_auth(), sepgsql_compute_avd(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_init_client_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_object_relabel(), sepgsql_relation_relabel(), sepgsql_restorecon(), sepgsql_set_client_label(), sepgsql_utility_command(), serialize_expr_stats(), serialize_prepare_info(), server_check_detail(), set_config_by_name(), set_config_with_handle(), set_max_safe_fds(), set_var_from_non_decimal_integer_str(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), setseed(), SetSequence(), SetSerializableTransactionSnapshot(), setTargetTable(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), setup_regexp_matches(), setup_test_matches(), SetUserIdAndContext(), SharedFileSetAttach(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_check_detail(), shell_finish_command(), shell_get_sink(), shell_in(), shell_out(), shm_mq_receive(), shm_mq_sendv(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemInitStruct(), should_apply_changes_for_rel(), should_refetch_tuple(), similar_escape_internal(), SlabContextCreate(), slot_modify_data(), slot_store_data(), slotsync_reread_config(), SnapBuildInitialSnapshot(), SnapBuildRestoreContents(), SnapBuildRestoreSnapshot(), socket_set_nonblocking(), SocketBackend(), sort(), spgadjustmembers(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgGetCache(), spgvalidate(), SPI_cursor_open_internal(), split_part(), SplitPartitionMoveRows(), sql_compile_callback(), sql_postrewrite_callback(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StandbySlotsHaveCaughtup(), StartBackgroundWorker(), StartChildProcess(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupXLOG(), statatt_build_stavalues(), statatt_get_type(), statext_dependencies_validate(), statext_mcv_import(), statext_ndistinct_validate(), stats_check_arg_array(), stats_check_arg_pair(), stats_check_required_arg(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), stream_abort_cb_wrapper(), stream_change_cb_wrapper(), stream_commit_cb_wrapper(), stream_prepare_cb_wrapper(), stream_start_cb_wrapper(), stream_stop_cb_wrapper(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), strlower_libc_mb(), strtitle_libc_mb(), strupper_libc_mb(), substitute_grouped_columns_mutator(), substitute_path_macro(), SummarizeWAL(), suppress_redundant_updates_trigger(), SV_to_JsonbValue(), SwitchToUntrustedUser(), synchronize_one_slot(), SyncRepWaitForLSN(), systable_beginscan_ordered(), systable_inplace_update_begin(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), table_tuple_get_latest_tid(), tablesample_init(), TablespaceCreateDbspace(), TargetPrivilegesCheck(), tblspc_redo(), TerminateOtherDBBackends(), test_custom_stats_var_create(), test_enc_conversion(), test_re_compile(), test_re_execute(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_starts_with(), text_substring(), text_to_bits(), textarray_to_strvaluelist(), textregexreplace(), textregexreplace_extended(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_mi_interval(), time_part_common(), time_pl_interval(), time_recv(), timestamp2date_safe(), timestamp2timestamptz_safe(), timestamp_age(), timestamp_bin(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part_common(), timestamp_pl_interval(), timestamp_random(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2date_safe(), timestamptz2timestamp_safe(), timestamptz_age(), timestamptz_bin(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part_common(), timestamptz_pl_interval_internal(), timestamptz_random(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc_internal(), timestamptz_zone(), timetz_izone(), timetz_mi_interval(), timetz_part_common(), timetz_pl_interval(), timetz_recv(), timetz_zone(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_timestamp(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformAlterTableStmt(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformContainerSubscripts(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFrameOffset(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), TransformGUCArray(), transformIndexConstraint(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformJsonAggConstructor(), transformJsonArrayQueryConstructor(), transformJsonBehavior(), transformJsonFuncExpr(), transformJsonIsPredicate(), transformJsonOutput(), transformJsonParseArg(), transformJsonParseExpr(), transformJsonReturning(), transformJsonSerializeExpr(), transformJsonTable(), transformJsonTableColumns(), transformJsonValueExpr(), transformLimitClause(), transformLockingClause(), transformMergeStmt(), transformMergeSupportFunc(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionCmdForMerge(), transformPartitionCmdForSplit(), transformPartitionRangeBounds(), transformPartitionSpec(), transformPLAssignStmtTarget(), TransformPubWhereClauses(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningClause(), transformRowExpr(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformStatsStmt(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), trim_array(), truncate_check_activity(), truncate_check_rel(), truncate_identifier(), tryAttachPartitionForeignKey(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_stat_sql(), tsquery_phrase_distance(), tsquery_rewrite_query(), tsvector_concat(), tsvector_filter(), tsvector_update_trigger(), tsvectorin(), tts_buffer_heap_getsysattr(), tts_buffer_is_current_xact_tuple(), tts_heap_getsysattr(), tts_heap_is_current_xact_tuple(), tts_minimal_getsysattr(), tts_minimal_is_current_xact_tuple(), tts_virtual_getsysattr(), tts_virtual_is_current_xact_tuple(), tuple_data_split(), tuple_data_split_internal(), tupledesc_match(), tuples_equal(), tuplesort_begin_index_gin(), TwoPhaseTransactionGid(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), uint32in_subr(), uint64in_subr(), unaccent_dict(), unaccent_init(), unicode_norm_form_from_string(), unique_key_recheck(), uniqueifyJsonbObject(), unistr(), unknown_attribute(), update_local_synced_slot(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vac_update_relstats(), vacuum(), vacuum_open_relation(), validate(), validate_ddl_tags(), validate_kvpair(), validate_option_array_item(), validate_pkattnums(), validate_relation_as_index(), validate_relation_as_sequence(), validate_relation_as_table(), validate_remote_info(), validate_table_rewrite_tags(), validate_token_format(), validateConnectbyTupleDesc(), validateDomainCheckConstraint(), validateDomainNotNullConstraint(), validateFkOnDeleteSetColumns(), validateInfiniteBounds(), ValidateInputLSNs(), ValidateJoinEstimator(), ValidateOperatorReference(), ValidatePgVersion(), validateRecoveryParameters(), ValidateRestrictionEstimator(), ValidateSlotSyncParams(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_levenshtein(), verify_brin_page(), verify_cb(), verify_dictoptions(), verify_gist_page(), verify_hash_page(), verify_heapam(), verifyBackupPageConsistency(), verifyNotNullPKCompatible(), verifyPartitionIndexNotNull(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitEventCustomNew(), WaitForLSN(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToExit(), WaitForParallelWorkersToFinish(), WaitForWalSummarization(), WalRcvFetchTimeLineHistoryFiles(), WALReadRaiseError(), WalReceiverMain(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), WinCheckAndInitializeNullTreatment(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), XLogFileCopy(), XLogPageRead(), XLogReadBufferForRedoExtended(), XlogReadTwoPhaseData(), XLogWalRcvProcessMsg(), xml_out_internal(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_options(), xmlvalidate(), xpath_table(), and xslt_process().

◆ errcode_for_file_access()

int errcode_for_file_access ( void  )
extern

Definition at line 897 of file elog.c.

898{
900
901 /* we don't bother incrementing recursion_depth */
903
904 switch (edata->saved_errno)
905 {
906 /* Permission-denied failures */
907 case EPERM: /* Not super-user */
908 case EACCES: /* Permission denied */
909#ifdef EROFS
910 case EROFS: /* Read only file system */
911#endif
913 break;
914
915 /* File not found */
916 case ENOENT: /* No such file or directory */
917 edata->sqlerrcode = ERRCODE_UNDEFINED_FILE;
918 break;
919
920 /* Duplicate file */
921 case EEXIST: /* File exists */
922 edata->sqlerrcode = ERRCODE_DUPLICATE_FILE;
923 break;
924
925 /* Wrong object type or state */
926 case ENOTDIR: /* Not a directory */
927 case EISDIR: /* Is a directory */
928#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
929 case ENOTEMPTY: /* Directory not empty */
930#endif
931 edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
932 break;
933
934 /* Insufficient resources */
935 case ENOSPC: /* No space left on device */
936 edata->sqlerrcode = ERRCODE_DISK_FULL;
937 break;
938
939 case ENOMEM: /* Out of memory */
940 edata->sqlerrcode = ERRCODE_OUT_OF_MEMORY;
941 break;
942
943 case ENFILE: /* File table overflow */
944 case EMFILE: /* Too many open files */
946 break;
947
948 /* Hardware failure */
949 case EIO: /* I/O error */
950 edata->sqlerrcode = ERRCODE_IO_ERROR;
951 break;
952
953 case ENAMETOOLONG: /* File name too long */
954 edata->sqlerrcode = ERRCODE_FILE_NAME_TOO_LONG;
955 break;
956
957 /* All else is classified as internal errors */
958 default:
959 edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
960 break;
961 }
962
963 return 0; /* return value does not matter */
964}

References CHECK_STACK_DEPTH, errordata, errordata_stack_depth, and fb().

Referenced by _mdfd_getseg(), _mdnblocks(), AddToDataDirLockFile(), AlterSystemSetConfigFile(), ApplyLogicalMappingFile(), apw_dump_now(), apw_load_buffers(), assign_wal_sync_method(), basebackup_read_file(), basic_archive_file(), bbsink_server_archive_contents(), bbsink_server_begin_archive(), bbsink_server_begin_manifest(), bbsink_server_end_archive(), bbsink_server_manifest_contents(), bbsink_server_new(), be_lo_export(), BeginCopyFrom(), BeginCopyTo(), BootStrapXLOG(), BufFileDumpBuffer(), BufFileLoadBuffer(), BufFileOpenFileSet(), BufFileReadCommon(), BufFileSeek(), BufFileSize(), BufFileTruncateFileSet(), calculate_relation_size(), calculate_tablespace_size(), ChangeToDataDir(), check_ssl_key_file_permissions(), checkDataDir(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckXLogRemoved(), clone_file(), ClosePipeFromProgram(), ClosePipeToProgram(), ClosePostmasterPorts(), compare_files(), copy_file(), copydir(), CopyGetData(), CopySendEndOfRow(), create_tablespace_directories(), CreateDirAndVersionFile(), CreateLockFile(), CreateOptsFile(), CreateSlotOnDisk(), db_dir_size(), DebugFileOpen(), DeleteAllExportedSnapshotFiles(), destroy_tablespace_directories(), do_pg_backup_stop(), do_truncate(), dsm_cleanup_for_mmap(), dsm_impl_mmap(), durable_rename(), durable_unlink(), EndCopy(), EndCopyFrom(), entry_reset(), errcode_for_dynamic_shared_memory(), ExecHashJoinNewBatch(), existsTimeLineHistory(), ExportSnapshot(), fileAnalyzeForeignTable(), FileClose(), fsync_fname_ext(), gc_qtexts(), get_controlfile_by_exact_path(), get_dirent_type(), get_tablespace_location(), GetConfFilesInDir(), getInstallationPaths(), hashagg_batch_read(), heap_xlog_logical_rewrite(), ImportSnapshot(), InitPostgres(), InitPostmasterDeathWatchHandle(), InitWalRecovery(), internal_load_library(), issue_xlog_fsync(), KeepFileRestoredFromArchive(), lo_import_internal(), load_dh_file(), logfile_open(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), ltsReadBlock(), ltsWriteBlock(), md_readv_report(), mdcreate(), mdextend(), mdimmedsync(), mdopenfork(), mdreadv(), mdstartreadv(), mdtruncate(), mdunlinkfork(), mdwritev(), mdzeroextend(), normalize_exec_path(), open_auth_file(), OpenWalSummaryFile(), parse_extension_control_file(), ParseConfigFile(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenTemporaryFile(), perform_base_backup(), pg_current_logfile(), pg_file_exists(), pg_flush_data(), pg_import_system_collations(), pg_ls_dir_files(), pg_promote(), pg_stat_file(), pg_tablespace_databases(), pg_tzenumerate_next(), pg_tzenumerate_start(), pgarch_archiveDone(), pgarch_readyXlog(), PGReserveSemaphores(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_discard_stats(), pgstat_read_statsfile(), pgstat_write_statsfile(), pipe_read_line(), PostmasterMain(), PrepareRedoAdd(), ProcessSyncRequests(), qtext_load_file(), qtext_store(), read_backup_label(), read_binary_file(), read_relmap_file(), read_tablespace_map(), read_whole_file(), ReadControlFile(), ReadDirExtended(), ReadNextXLogRecord(), readRecoverySignalFile(), readTimeLineHistory(), ReadTwoPhaseFile(), ReadWalSummary(), RecheckDataDirLockFile(), RecreateTwoPhaseFile(), register_dirty_segment(), remove_tablespace_symlink(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemoveTwoPhaseFile(), RemoveWalSummaryIfOlderThan(), RemoveXlogFile(), ReorderBufferCleanupSerializedTXNs(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), ReplicationSlotDropPtr(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), RestoreArchivedFile(), RestoreSlotFromDisk(), run_ssl_passphrase_command(), SaveSlotToPath(), SendBackupManifest(), sendDir(), sendFile(), sendTablespace(), SendTimeLineHistory(), Setup_AF_UNIX(), shell_finish_command(), shell_run_command(), shell_send_data(), SlruReportIOError(), SnapBuildRestoreContents(), SnapBuildRestoreSnapshot(), SnapBuildSerialize(), SnapBuildSnapshotExists(), StartupReplicationOrigin(), sts_parallel_scan_next(), sts_read_tuple(), SummarizeWAL(), SyncDataDirectory(), SyncPostCheckpoint(), SysLogger_Start(), TablespaceCreateDbspace(), test_custom_stats_var_finish(), test_custom_stats_var_from_serialized_data(), test_custom_stats_var_to_serialized_data(), tokenize_auth_file(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), unlink_if_exists_fname(), unlink_initfile(), update_controlfile(), update_metainfo_datafile(), ValidatePgVersion(), ValidateXLOGDirectoryStructure(), wal_segment_open(), WALReadRaiseError(), WalReceiverMain(), WalSndSegmentOpen(), write_auto_conf_file(), write_item(), write_relcache_init_file(), write_relmap_file(), WriteControlFile(), writeTimeLineHistory(), writeTimeLineHistoryFile(), WriteWalSummary(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileInitInternal(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogInitNewTimeline(), XLogPageRead(), XlogReadTwoPhaseData(), XLogWalRcvClose(), XLogWalRcvWrite(), and XLogWrite().

◆ errcode_for_socket_access()

int errcode_for_socket_access ( void  )
extern

Definition at line 976 of file elog.c.

977{
979
980 /* we don't bother incrementing recursion_depth */
982
983 switch (edata->saved_errno)
984 {
985 /* Loss of connection */
987 edata->sqlerrcode = ERRCODE_CONNECTION_FAILURE;
988 break;
989
990 /* All else is classified as internal errors */
991 default:
992 edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
993 break;
994 }
995
996 return 0; /* return value does not matter */
997}
#define ALL_CONNECTION_FAILURE_ERRNOS
Definition port.h:122

References ALL_CONNECTION_FAILURE_ERRNOS, CHECK_STACK_DEPTH, errordata, errordata_stack_depth, and fb().

Referenced by AcceptConnection(), auth_peer(), be_tls_open_server(), ident_inet(), InitPostmasterChild(), InitPostmasterDeathWatchHandle(), internal_flush_buffer(), ListenServerPort(), pq_getbyte_if_available(), pq_recvbuf(), ProcessStartupPacket(), SysLogger_Start(), SysLoggerMain(), and WaitEventSetWaitBlock().

◆ errcontext_msg()

int errcontext_msg ( const char fmt,
  ... 
)
extern

◆ errdetail()

int errdetail ( const char fmt,
  ... 
)
extern

Referenced by _bt_check_third_page(), _bt_check_unique(), _PG_init(), AbortBufferIO(), AddEnumLabel(), AddRelationNotNullConstraints(), addUnicode(), addUnicodeChar(), AdjustNotNullInheritance(), AggregateCreate(), AllocSetContextCreateInternal(), AlterExtensionNamespace(), AlterPublicationOptions(), AlterPublicationSchemas(), AlterRole(), AlterRoleSet(), AlterTableNamespace(), apply_typmod(), apply_typmod_special(), array_cat(), array_fill_internal(), array_in(), array_set_slice(), assignable_custom_variable_name(), asyncQueueFillWarning(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddInherit(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecDropExpression(), ATExecSetExpression(), ATExecValidateConstraint(), ATPrepAlterColumnType(), ATPrepChangePersistence(), AttachPartitionEnsureIndexes(), attribute_statistics_update(), BackendInitialize(), bbsink_server_new(), be_tls_init(), BeginCopyTo(), brin_page_type(), bt_entry_unique_check(), bt_page_items_bytea(), bt_report_duplicate(), buffer_readv_report(), build_attrmap_by_name(), build_attrmap_by_position(), build_mvdependencies(), build_mvndistinct(), BumpContextCreate(), check_agg_arguments(), check_av_worker_gucs(), check_conn_params(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_lateral_ref_ok(), check_nested_generated_walker(), check_new_partition_bound(), check_object_ownership(), check_of_type(), check_partition_bounds_for_split_range(), check_password(), check_primary_key(), check_publication_add_relation(), check_publication_add_schema(), check_role_grantor(), check_role_membership_authorization(), check_sql_stmt_retval(), check_ssl_key_file_permissions(), check_two_partitions_bounds_range(), check_valid_extension_name(), check_valid_version_name(), check_virtual_generated_security_walker(), CheckAlterPublication(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkMembershipInCurrentExtension(), CheckMyDatabase(), CheckPubRelationColumnList(), CheckRecoveryConflictDeadlock(), CheckRequiredParameterValues(), checkRuleResultList(), CheckSlotPermissions(), checkStringLen(), CheckTablespaceDirectory(), CheckVarSlotCompatibility(), clear_subscription_skip_lsn(), coerce_record_to_complex(), comparetup_index_btree_tiebreak(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), copy_replication_slot(), copy_table_data(), CopyGetAttnums(), CopyReadAttributesCSV(), CopyReadAttributesText(), countVariablesFromJsonb(), create_distinct_paths(), create_ordinary_grouping_paths(), create_pg_locale(), createdb(), CreateDecodingContext(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateSubscription(), CreateTableSpace(), CreateTriggerFiringOn(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_recv(), cube_subset(), cube_yyerror(), DateTimeParseError(), dblink_connstr_check(), dblink_fdw_validator(), dblink_security_check(), DCH_from_char(), defGetGeneratedColsOption(), DefineCollation(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineRelation(), DefineView(), DeleteInheritsTuple(), dependencies_array_element_start(), dependencies_array_end(), dependencies_array_start(), dependencies_object_end(), dependencies_object_field_start(), dependencies_object_start(), dependencies_scalar(), DoCopy(), DropOwnedObjects(), DropRole(), dsa_allocate_extended(), dshash_create(), EmitConnectionWarnings(), EnableLockPagesPrivilege(), encrypt_password(), enforce_generic_type_consistency(), enlargeStringInfo(), EnumValuesCreate(), errdetail_busy_db(), errdetail_execute(), errdetail_params(), errdetail_recovery_conflict(), errdetail_relkind_not_supported(), error_multiple_recovery_targets(), errorMissingColumn(), errorMissingRTE(), EvaluateParams(), exec_move_row_from_fields(), exec_stmt_dynexecute(), exec_stmt_execsql(), ExecBRInsertTriggers(), ExecBuildUpdateProjection(), ExecCheckPlanOutput(), ExecCheckpoint(), ExecConstraints(), ExecCrossPartitionUpdate(), ExecCrossPartitionUpdateForeignKey(), ExecEvalArrayExpr(), ExecEvalFieldSelect(), ExecEvalJsonCoercionFinish(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language_check(), ExecPartitionCheckEmitError(), ExecWaitStmt(), ExecWithCheckOptions(), expandTableLikeClause(), fatal_llvm_new_handler(), fatal_system_new_handler(), file_fdw_validator(), FindFKPeriodOpers(), finish_nodeitem(), FloatExceptionHandler(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), func_lookup_failure_details(), generate_nonunion_paths(), generate_recursion_path(), generateClonedIndexStmt(), GenerationContextCreate(), get_connect_string(), get_crosstab_tuplestore(), get_page_from_raw(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), getid(), GetOperatorFromCompareType(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), gistdoinsert(), gistvacuumpage(), heap_create(), heap_truncate_check_FKs(), hlparsetext(), incompatible_module_error(), index_checkable(), InitializeMaxBackends(), InitPgFdwOptions(), InitPostgres(), InitWalRecovery(), InitXLogReaderState(), instantiate_empty_record_variable(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), interval_trunc(), jsonb_set_lax(), lazy_check_wraparound_failsafe(), libpqrcv_check_conninfo(), libpqrcv_connect(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), libpqsrv_connect_prepare(), load_categories_hash(), load_validator_library(), LoadArchiveLibrary(), LoadPublications(), LogChildExit(), ltxtq_out(), ltxtq_send(), LWLockNewTrancheId(), make_pathkeys_for_window(), make_row_comparison_op(), makeMultirangeTypeName(), map_sql_value_to_xml_value(), MarkGUCPrefixReserved(), matchLocks(), MemoryContextAllocationFailure(), MergeAttributes(), MergeAttributesIntoExisting(), MergeChildAttribute(), MergeInheritedAttribute(), multirange_in(), namerecv(), ndistinct_array_element_start(), ndistinct_array_end(), ndistinct_array_start(), ndistinct_object_end(), ndistinct_object_field_start(), ndistinct_object_start(), ndistinct_scalar(), network_in(), network_recv(), NUMDesc_prepare(), oauth_exchange(), op_error(), oper_lookup_failure_details(), parse_ident(), parse_kvpairs_for_auth(), parse_lquery(), parse_ltree(), parse_one_reloption(), ParseFuncOrColumn(), parserOpenTable(), parsetext(), parseUnicode(), perform_default_encoding_conversion(), pg_cancel_backend(), pg_dependencies_in(), pg_do_encoding_conversion(), pg_get_wal_record_info(), pg_get_wal_records_info_till_end_of_wal(), pg_get_wal_stats_till_end_of_wal(), pg_ndistinct_in(), pg_replication_origin_create(), pg_replication_slot_advance(), pg_size_bytes(), pg_terminate_backend(), pgfdw_security_check(), pgrowlocks(), PGSharedMemoryCreate(), pgstat_get_entry_ref(), pgstat_register_kind(), plpgsql_post_column_ref(), PLy_exec_function(), PLy_exec_trigger(), PLyUnicode_ToComposite(), populate_array_check_dimension(), PrepareForIncrementalBackup(), PrepareRedoAdd(), preprocess_grouping_sets(), ProcedureCreate(), process_owned_by(), ProcessPgArchInterrupts(), ProcessStartupPacket(), ProcessUtilitySlow(), qtext_load_file(), queryin(), quickdie(), range_parse(), range_parse_bound(), read_any_attr(), read_attr_value(), read_backup_label(), read_client_final_message(), read_client_first_message(), ReadArrayDimensions(), ReadArrayStr(), ReadArrayToken(), ReadControlFile(), ReassignOwnedObjects(), record_in(), recordDependencyOnCurrentExtension(), RecoveryRequiresIntParameter(), refresh_by_match_merge(), refuseDupeIndexAttach(), RegisterCustomRmgr(), ReindexRelationConcurrently(), RememberAllDependentForRebuilding(), RemoveSubscriptionRel(), RenameEnumLabel(), RenameRole(), RenameSchema(), RenameTableSpace(), replace_percent_placeholders(), ReplicationSlotAcquire(), ReplicationSlotAlter(), ReplicationSlotDrop(), replorigin_create(), replorigin_session_reset(), report_newlocale_failure(), ReportNotNullViolationError(), RequestNamedLWLockTranche(), RestoreArchivedFile(), resume_conflict_info_retention(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), scram_exchange(), seg_yyerror(), set_max_safe_fds(), setPath(), SetTransactionSnapshot(), shell_archive_file(), should_apply_changes_for_rel(), SlabContextCreate(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), sql_compile_callback(), StandbySlotsHaveCaughtup(), StartReplication(), StartupDecodingContext(), stop_conflict_info_retention(), substitute_grouped_columns_mutator(), SummarizeWAL(), SyncRepWaitForLSN(), TerminateOtherDBBackends(), test_custom_stats_var_create(), test_enc_conversion(), tfuncInitialize(), transformAggregateCall(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformIndexConstraint(), transformJsonBehavior(), transformJsonFuncExpr(), transformJsonTable(), transformMergeStmt(), TransformPubWhereClauses(), transformSetOperationStmt(), tupledesc_match(), update_local_synced_slot(), vac_cleanup_one_index(), vac_truncate_clog(), validate_kvpair(), validateConnectbyTupleDesc(), ValidateInputLSNs(), ValidatePgVersion(), variable_coerce_param_hook(), verify_brin_page(), verify_gist_page(), verify_hash_page(), verify_message(), verifyNotNullPKCompatible(), verifyPartitionIndexNotNull(), WaitForWalSummarization(), WalReceiverMain(), write_relcache_init_file(), XlogReadTwoPhaseData(), xmlpi(), and xpath_table().

◆ errdetail_internal()

int int errdetail_internal ( const char fmt,
  ... 
)
extern

Referenced by AggregateCreate(), be_tls_open_server(), bloom_get_procinfo(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_leftmost_ignoring_half_dead(), bt_recheck_sibling_links(), bt_right_page_check_scankey(), bt_target_page_check(), buffer_readv_report(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), check_rolespec_name(), check_simple_rowfilter_expr_walker(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), ClosePipeFromProgram(), ClosePipeToProgram(), connect_pg_server(), dblink_connect(), dblink_get_conn(), dblink_res_error(), DeadLockReport(), DropRole(), DropTableSpace(), elog_node_display(), error_view_not_updatable(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), FreezeMultiXactId(), GetConnection(), inclusion_get_procinfo(), incompatible_module_error(), json_errsave_error(), minmax_multi_get_procinfo(), OnConflict_CheckForSerializationFailure(), PageGetItemIdCareful(), PageGetItemIdCareful(), parse_one_reloption(), pg_GSS_error(), pgaio_io_wait_for_free(), pgarch_ArchiverCopyLoop(), pgfdw_report_internal(), PLy_elog_impl(), PLy_output(), PreCommit_CheckForSerializationFailure(), ProcedureCreate(), reindex_index(), ReportApplyConflict(), reportDependentObjects(), ReportSlotInvalidation(), rewriteTargetView(), run_ssl_passphrase_command(), shell_finish_command(), ShowUsage(), SnapBuildFindSnapshot(), sts_read_tuple(), synchronize_one_slot(), update_local_synced_slot(), wait_for_local_flush(), XLogRecordAssemble(), XLogRegisterBufData(), and XLogRegisterData().

◆ errdetail_log()

◆ errdetail_log_plural()

int int int int errdetail_log_plural ( const char fmt_singular,
const char fmt_plural,
unsigned long  n,
  ... 
)
extern

◆ errdetail_plural()

◆ errfinish()

void errfinish ( const char filename,
int  lineno,
const char funcname 
)
extern

Definition at line 485 of file elog.c.

486{
488 int elevel;
489 MemoryContext oldcontext;
490 ErrorContextCallback *econtext;
491
494
495 /* Save the last few bits of error state into the stack entry */
497
498 elevel = edata->elevel;
499
500 /*
501 * Do processing in ErrorContext, which we hope has enough reserved space
502 * to report an error.
503 */
505
506 /* Collect backtrace, if enabled and we didn't already */
507 if (!edata->backtrace &&
508 edata->funcname &&
512
513 /*
514 * Call any context callback functions. Errors occurring in callback
515 * functions will be treated as recursive errors --- this ensures we will
516 * avoid infinite recursion (see errstart).
517 */
518 for (econtext = error_context_stack;
519 econtext != NULL;
520 econtext = econtext->previous)
521 econtext->callback(econtext->arg);
522
523 /*
524 * If ERROR (not more nor less) we pass it off to the current handler.
525 * Printing it and popping the stack is the responsibility of the handler.
526 */
527 if (elevel == ERROR)
528 {
529 /*
530 * We do some minimal cleanup before longjmp'ing so that handlers can
531 * execute in a reasonably sane state.
532 *
533 * Reset InterruptHoldoffCount in case we ereport'd from inside an
534 * interrupt holdoff section. (We assume here that no handler will
535 * itself be inside a holdoff section. If necessary, such a handler
536 * could save and restore InterruptHoldoffCount for itself, but this
537 * should make life easier for most.)
538 */
541
542 CritSectionCount = 0; /* should be unnecessary, but... */
543
544 /*
545 * Note that we leave CurrentMemoryContext set to ErrorContext. The
546 * handler should reset it to something else soon.
547 */
548
550 PG_RE_THROW();
551 }
552
553 /* Emit the message to the right places */
555
556 /*
557 * If this is the outermost recursion level, we can clean up by resetting
558 * ErrorContext altogether (compare FlushErrorState), which is good
559 * because it cleans up any random leakages that might have occurred in
560 * places such as context callback functions. If we're nested, we can
561 * only safely remove the subsidiary data of the current stack entry.
562 */
563 if (errordata_stack_depth == 0 && recursion_depth == 1)
565 else
567
568 /* Release stack entry and exit error-handling context */
570 MemoryContextSwitchTo(oldcontext);
572
573 /*
574 * Perform error recovery action as specified by elevel.
575 */
576 if (elevel == FATAL)
577 {
578 /*
579 * For a FATAL error, we let proc_exit clean up and exit.
580 *
581 * If we just reported a startup failure, the client will disconnect
582 * on receiving it, so don't send any more to the client.
583 */
586
587 /*
588 * fflush here is just to improve the odds that we get to see the
589 * error message, in case things are so hosed that proc_exit crashes.
590 * Any other code you might be tempted to add here should probably be
591 * in an on_proc_exit or on_shmem_exit callback instead.
592 */
593 fflush(NULL);
594
595 /*
596 * Let the cumulative stats system know. Only mark the session as
597 * terminated by fatal error if there is no other known cause.
598 */
601
602 /*
603 * Do normal process-exit cleanup, then return exit code 1 to indicate
604 * FATAL termination. The postmaster may or may not consider this
605 * worthy of panic, depending on which subprocess returns it.
606 */
607 proc_exit(1);
608 }
609
610 if (elevel >= PANIC)
611 {
612 /*
613 * Serious crash time. Postmaster will observe SIGABRT process exit
614 * status and kill the other backends too.
615 *
616 * XXX: what if we are *in* the postmaster? abort() won't kill our
617 * children...
618 */
619 fflush(NULL);
620 abort();
621 }
622
623 /*
624 * Check for cancel/die interrupt first --- this is so that the user can
625 * stop a query emitting tons of notice or warning messages, even if it's
626 * in a loop that otherwise fails to check for interrupts.
627 */
629}
@ DestRemote
Definition dest.h:89
@ DestNone
Definition dest.h:87
void EmitErrorReport(void)
Definition elog.c:1882
static void FreeErrorDataContents(ErrorData *edata)
Definition elog.c:2025
ErrorContextCallback * error_context_stack
Definition elog.c:99
static bool matches_backtrace_functions(const char *funcname)
Definition elog.c:846
static void set_stack_entry_location(ErrorData *edata, const char *filename, int lineno, const char *funcname)
Definition elog.c:816
sigjmp_buf * PG_exception_stack
Definition elog.c:101
#define PG_RE_THROW()
Definition elog.h:405
#define PANIC
Definition elog.h:42
volatile uint32 QueryCancelHoldoffCount
Definition globals.c:44
volatile uint32 InterruptHoldoffCount
Definition globals.c:43
volatile uint32 CritSectionCount
Definition globals.c:45
char * backtrace_functions
Definition guc_tables.c:558
void proc_exit(int code)
Definition ipc.c:105
void MemoryContextReset(MemoryContext context)
Definition mcxt.c:403
#define CHECK_FOR_INTERRUPTS()
Definition miscadmin.h:123
@ DISCONNECT_FATAL
Definition pgstat.h:63
@ DISCONNECT_NORMAL
Definition pgstat.h:61
SessionEndType pgStatSessionEndCause
CommandDest whereToSendOutput
Definition postgres.c:93
void(* callback)(void *arg)
Definition elog.h:298

References ErrorContextCallback::arg, backtrace_functions, ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, CHECK_STACK_DEPTH, CritSectionCount, DestNone, DestRemote, DISCONNECT_FATAL, DISCONNECT_NORMAL, EmitErrorReport(), ERROR, error_context_stack, ErrorContext, errordata, errordata_stack_depth, FATAL, fb(), filename, FreeErrorDataContents(), funcname, InterruptHoldoffCount, matches_backtrace_functions(), MemoryContextReset(), MemoryContextSwitchTo(), PANIC, PG_exception_stack, PG_RE_THROW, pgStatSessionEndCause, ErrorContextCallback::previous, proc_exit(), QueryCancelHoldoffCount, recursion_depth, set_backtrace(), set_stack_entry_location(), and whereToSendOutput.

Referenced by errsave_finish(), pg_re_throw(), and ThrowErrorData().

◆ errhidecontext()

◆ errhidestmt()

◆ errhint()

int errhint ( const char fmt,
  ... 
)
extern

Referenced by _bt_check_third_page(), _bt_check_unique(), _bt_checkpage(), _bt_pagedel(), _hash_checkpage(), _hash_doinsert(), aclparse(), addTargetToSortList(), AdjustNotNullInheritance(), AlterCollation(), AlterDatabase(), AlterEventTriggerOwner_internal(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner_internal(), AlterObjectRename_internal(), AlterPublicationOwner_internal(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), analyzeCTE(), apw_start_database_worker(), apw_start_leader_worker(), assign_collations_walker(), assign_hypothetical_collations(), assignProcTypes(), asyncQueueFillWarning(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddIdentity(), ATExecAlterConstraint(), ATExecChangeOwner(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetRelOptions(), ATExecSetStatistics(), ATPrepAlterColumnType(), ATPrepCmd(), attribute_statistics_update(), autovac_init(), BackendInitialize(), bbsink_server_archive_contents(), bbsink_server_manifest_contents(), be_tls_open_server(), BeginCopyFrom(), BeginCopyTo(), binary_decode(), binary_encode(), brin_desummarize_range(), brin_page_items(), brin_summarize_range(), bt_check_every_level(), bt_entry_unique_check(), bt_index_check_callback(), bt_metap(), bt_target_page_check(), bt_tuple_present_callback(), build_column_default(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), char2wchar(), check_agg_arguments_walker(), check_collation_set(), check_collation_set(), check_enable_rls(), check_index_page(), check_lateral_ref_ok(), check_parent_values_in_new_partitions(), check_partition_bounds_for_split_range(), check_publications_origin_sequences(), check_publications_origin_tables(), check_safe_enum_use(), check_stack_depth(), check_two_partitions_bounds_range(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), checkJsonOutputFormat(), CheckLogicalDecodingRequirements(), CheckMyDatabase(), checkPartition(), CheckpointerMain(), CheckRequiredParameterValues(), CheckSubDeadTupleRetention(), CheckTablespaceDirectory(), checkTimezoneIsUsedForCast(), checkViewColumns(), compileTheLexeme(), ComputeIndexAttrs(), ComputePartitionAttrs(), cookDefault(), copy_replication_slot(), CopyFrom(), CopyReadLineText(), create_ctas_nodata(), create_pg_locale(), create_tablespace_directories(), CreateAccessMethod(), CreateAnonymousSegment(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateForeignDataWrapper(), CreateFunction(), CreateLockFile(), CreatePredicateLock(), CreatePublication(), CreateSubscription(), CreateTableSpace(), CreateTriggerFiringOn(), DateTimeParseError(), dblink_fdw_validator(), dblink_res_error(), dblink_security_check(), DeadLockReport(), DefineQueryRewrite(), DefineRange(), DefineType(), DefineView(), DefineVirtualRelation(), DeleteInheritsTuple(), do_pg_backup_start(), do_pg_backup_stop(), do_to_timestamp(), DoCopy(), DoPortalRewind(), DropErrorMsgWrongType(), EnableLockPagesPrivilege(), encrypt_password(), error_commit_ts_disabled(), error_view_not_updatable(), errorMissingColumn(), errorMissingRTE(), EvaluateParams(), exec_move_row_from_fields(), exec_stmt_case(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), ExecCrossPartitionUpdateForeignKey(), ExecDelete(), ExecGrant_Type_check(), ExecMergeMatched(), ExecOnConflictLockRow(), ExecOpenScanRelation(), ExecUpdate(), execute_extension_script(), executeDateTimeMethod(), ExecuteDoStmt(), ExecuteTruncate(), ExecWaitStmt(), ExitPostmaster(), extended_statistics_update(), FastPathGetRelationLockEntry(), fetch_finfo_record(), file_fdw_validator(), find_typed_table_dependencies(), findDependentObjects(), findRangeSubOpclass(), forkname_to_number(), from_char_parse_int_len(), from_char_set_mode(), func_lookup_failure_details(), Generic_Text_IC_like(), GenericMatchText(), get_object_address_defacl(), get_raw_page(), get_record_type_from_query(), get_required_extension(), get_sort_group_operators(), getInstallationPaths(), GetNewMultiXactId(), GetNewTransactionId(), GetSerializableTransactionSnapshot(), GetTupleForTrigger(), gin_clean_pending_list(), ginCombineData(), ginNewScanKey(), gistcheckpage(), gistdoinsert(), gistUserPicksplit(), gistvacuumpage(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), heap_create_with_catalog(), heap_force_common(), heap_truncate_check_FKs(), icu_validate_locale(), initialize_ecdh(), InitPostgres(), InitWalRecovery(), internal_load_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), intorel_startup(), IpcSemaphoreInitialize(), json_build_object_worker(), jsonb_build_object_worker(), jsonb_set_lax(), jsonb_subscript_transform(), JsonPathQuery(), lazy_check_wraparound_failsafe(), libpqrcv_connect(), libpqsrv_connect_prepare(), like_fixed_prefix_ci(), ListenServerPort(), LoadPublications(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LogChildExit(), logicalrep_worker_launch(), LookupFuncName(), LookupFuncWithArgs(), macaddr8tomacaddr(), make_row_comparison_op(), makeMultirangeTypeName(), MarkAsPreparing(), MarkInheritDetached(), mdextend(), mdwritev(), mdzeroextend(), MergeAttributes(), MergeChildAttribute(), movedb(), OnConflict_CheckForSerializationFailure(), op_error(), oper_lookup_failure_details(), palloc_btree_page(), parse_and_validate_value(), parse_extension_control_file(), parse_hba_line(), parse_jsonb_index_flags(), parse_sane_timezone(), ParseFuncOrColumn(), parserOpenTable(), partitioned_table_reloptions(), pg_backup_stop(), pg_base64_decode_internal(), pg_clear_attribute_stats(), pg_clear_extended_stats(), pg_create_restore_point(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_get_wal_replay_pause_state(), pg_is_wal_replay_paused(), pg_log_standby_snapshot(), pg_prewarm(), pg_promote(), pg_set_regex_collation(), pg_size_bytes(), pg_stat_reset_shared(), pg_switch_wal(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgfdw_report_internal(), pgfdw_security_check(), PGSharedMemoryCreate(), pgstat_register_kind(), plan_recursive_revoke(), plpgsql_compile_callback(), PLy_elog_impl(), PLy_output(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyUnicode_ToComposite(), policy_role_list_to_array(), populate_array_report_expected_array(), PortalRunSelect(), postgres_fdw_validator(), postgresql_fdw_validator(), PostmasterMain(), PreCommit_CheckForSerializationFailure(), PrepareForIncrementalBackup(), PrepareRedoAdd(), ProcedureCreate(), process_owned_by(), process_postgres_switches(), ProcessStartupPacket(), px_crypt_shacrypt(), quickdie(), range_parse_flags(), RangeVarCallbackForAlterRelation(), read_backup_label(), ReadControlFile(), readTimeLineHistory(), recoveryPausesHere(), RecoveryRequiresIntParameter(), recursive_revoke(), RefreshMatViewByOid(), regexp_match(), RegisterBackgroundWorker(), RegisterCustomRmgr(), regoperatorin(), ReindexRelationConcurrently(), relation_statistics_update(), ReleaseOneSerializableXact(), RemoveObjects(), RemoveSubscriptionRel(), renametrig(), RenameType(), ReplicationSlotCreate(), replorigin_advance(), replorigin_session_reset(), replorigin_session_setup(), report_recovery_conflict(), reportDependentObjects(), ReportSlotConnectionError(), ReportSlotInvalidation(), RequestCheckpoint(), resolve_column_ref(), ResolveOpClass(), RestoreSlotFromDisk(), RewriteQuery(), rewriteTargetListIU(), rewriteTargetView(), ri_FetchConstraintInfo(), ri_PerformCheck(), RmgrNotFound(), select_common_collation(), sendDir(), SetMultiXactIdLimit(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), SetTransactionIdLimit(), setup_background_workers(), shell_archive_file(), shell_get_sink(), similar_escape_internal(), spgdoinsert(), spgFormInnerTuple(), StandbySlotsHaveCaughtup(), StartupXLOG(), stats_fill_fcinfo_from_arg_pairs(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), SysLogger_Start(), tblspc_redo(), text_format(), textregexreplace(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformCaseExpr(), transformCoalesceExpr(), transformFrameOffset(), transformInsertRow(), transformJsonBehavior(), transformJsonReturning(), transformJsonSerializeExpr(), transformOnConflictArbiter(), transformPartitionCmdForSplit(), transformPLAssignStmtTarget(), transformRangeFunction(), transformSetOperationStmt(), transformUpdateTargetList(), transformWindowDefinitions(), unistr(), vacuum_get_cutoffs(), validate_remote_info(), ValidatePgVersion(), validateRecoveryParameters(), ValidateSlotSyncParams(), verify_heapam(), verifyNotNullPKCompatible(), VirtualXactLock(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), worker_spi_launch(), and WriteWalSummary().

◆ errhint_internal()

int int errhint_internal ( const char fmt,
  ... 
)
extern

◆ errhint_plural()

int int int errhint_plural ( const char fmt_singular,
const char fmt_plural,
unsigned long  n,
  ... 
)
extern

◆ errmsg()

int errmsg ( const char fmt,
  ... 
)
extern

◆ errmsg_internal()

int int errmsg_internal ( const char fmt,
  ... 
)
extern

Referenced by _bt_binsrch_insert(), _bt_get_endpoint(), _bt_insert_parent(), _bt_insertonpg(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_preprocess_array_keys_final(), _bt_split(), _bt_unlink_halfdead_page(), _dosmaperr(), AlterSubscription_refresh(), AlterSubscription_refresh_seq(), apply_handle_begin_prepare(), apply_handle_commit(), apply_handle_origin(), apply_handle_prepare(), apply_handle_stream_abort(), apply_handle_stream_commit(), apply_handle_stream_prepare(), apply_handle_stream_start(), apply_handle_stream_stop(), ApplyLauncherMain(), apw_dump_now(), ATRewriteTable(), AutoVacLauncherMain(), AutoVacLauncherShutdown(), AutoVacWorkerMain(), BackendInitialize(), BackendStartup(), BackgroundWorkerStateChange(), before_shmem_exit(), BeginCopyFrom(), bloom_get_procinfo(), brinGetTupleForHeapBlock(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_missing_check(), bt_leftmost_ignoring_half_dead(), bt_recheck_sibling_links(), bt_right_page_check_scankey(), bt_target_page_check(), BTreeTupleGetHeapTIDCareful(), btvacuumpage(), buffer_readv_report(), build_attrmap_by_position(), byteaout(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), check_agglevels_and_constraints(), check_default_partition_contents(), check_srf_call_placement(), ClosePostmasterPorts(), CompactCheckpointerRequestQueue(), CopyXLogRecordToWAL(), CountChildren(), create_and_test_bloom(), CreateCheckPoint(), CreateRestartPoint(), dblink_res_error(), DefineIndex(), do_analyze_rel(), elog_node_display(), enforce_generic_type_consistency(), errno_from_string(), exec_bind_message(), exec_parse_message(), exec_replication_command(), exec_stmt_assert(), exec_stmt_raise(), ExecuteRecoveryCommand(), ForgetBackgroundWorker(), fprintf_to_ereport(), fprintf_to_ereport(), fprintf_to_ereport(), fprintf_to_ereport(), fprintf_to_ereport(), fprintf_to_ereport(), fprintf_to_ereport(), FreezeMultiXactId(), generateSerialExtraStmts(), get_error_stack_entry(), get_object_property_data(), GetConnection(), GetFileBackupMethod(), GetOldestUnsummarizedLSN(), GetSafeSnapshot(), GetWALBlockInfo(), handle_streamed_transaction(), hashagg_batch_read(), heap_fetch_toast_slice(), heap_getnext(), heap_inplace_lock(), heap_pre_freeze_checks(), heap_prepare_freeze_tuple(), heap_vacuum_rel(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_tuple_lock(), inclusion_get_procinfo(), index_build(), index_delete_check_htid(), info_cb(), InitPostmasterChild(), InitPostmasterDeathWatchHandle(), InitWalRecovery(), InsertOneValue(), inv_seek(), inv_truncate(), IpcSemaphoreInitialize(), issue_xlog_fsync(), libpqsrv_notice_receiver(), llvm_compile_module(), load_critical_index(), load_dh_buffer(), load_libraries(), logicalrep_worker_launch(), lz4_decompress_datum(), lz4_decompress_datum_slice(), manifest_report_error(), MemoryContextStatsDetail(), MemoryContextStatsInternal(), MemoryContextStatsPrint(), minmax_multi_get_procinfo(), NotNullImpliedByRelConstraints(), on_proc_exit(), on_shmem_exit(), palloc_btree_page(), PerformAuthentication(), pg_GSS_error(), pg_tzenumerate_next(), pgaio_io_wait_for_free(), pgfdw_report_internal(), pglz_decompress_datum(), pglz_decompress_datum_slice(), PGSharedMemoryCreate(), pgstat_discard_stats(), pgwin32_recv(), pgwin32_signal_initialize(), pgwin32_waitforsinglesocket(), PLy_elog_impl(), PLy_output(), PostmasterMain(), PrepareForIncrementalBackup(), process_pm_child_exit(), process_pm_pmsignal(), process_pm_reload_request(), process_pm_shutdown_request(), ProcessInterrupts(), ProcessSyncRequests(), ProcessWalSummarizerInterrupts(), ProcSleep(), QueuePartitionConstraintValidation(), read_backup_label(), ReadRecord(), register_dirty_segment(), RegisterBackgroundWorker(), RelationCacheInitializePhase3(), RemoveWalSummaryIfOlderThan(), RemoveXlogFile(), replication_yyerror(), ReplicationSlotValidateName(), reportDependentObjects(), ReportWalSummaryError(), RestoreArchivedFile(), run_apply_worker(), secure_open_server(), SendCancelRequest(), setitimer(), SetMultiXactIdLimit(), SetOldestOffset(), SetTransactionIdLimit(), shell_archive_file(), ShowTransactionStateRec(), ShowUsage(), signal_child(), SlruInternalDeleteSegment(), SnapBuildFindSnapshot(), SocketBackend(), StartBackgroundWorker(), StartupXLOG(), statistic_proc_security_check(), summarizer_read_local_xlog_page(), SummarizeWAL(), synchronize_one_slot(), SyncRepInitConfig(), SysLoggerMain(), test_custom_stats_var_finish(), transformColumnRef(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), TwoPhaseTransactionGid(), update_local_synced_slot(), UpdateMinRecoveryPoint(), vac_update_relstats(), validateForeignKeyConstraint(), verifyBackupPageConsistency(), wait_for_local_flush(), WalRcvFetchTimeLineHistoryFiles(), WalSndLoop(), WalSummarizerMain(), write_item(), write_relcache_init_file(), XLogPageRead(), XLogReadBufferForRedoExtended(), XLogRecordAssemble(), XLogRegisterBufData(), XLogRegisterData(), XLogWalRcvProcessMsg(), and xml_out_internal().

◆ errmsg_plural()

◆ error_severity()

const char * error_severity ( int  elevel)
extern

Definition at line 4154 of file elog.c.

4155{
4156 const char *prefix;
4157
4158 switch (elevel)
4159 {
4160 case DEBUG1:
4161 case DEBUG2:
4162 case DEBUG3:
4163 case DEBUG4:
4164 case DEBUG5:
4165 prefix = gettext_noop("DEBUG");
4166 break;
4167 case LOG:
4168 case LOG_SERVER_ONLY:
4169 prefix = gettext_noop("LOG");
4170 break;
4171 case INFO:
4172 prefix = gettext_noop("INFO");
4173 break;
4174 case NOTICE:
4175 prefix = gettext_noop("NOTICE");
4176 break;
4177 case WARNING:
4179 prefix = gettext_noop("WARNING");
4180 break;
4181 case ERROR:
4182 prefix = gettext_noop("ERROR");
4183 break;
4184 case FATAL:
4185 prefix = gettext_noop("FATAL");
4186 break;
4187 case PANIC:
4188 prefix = gettext_noop("PANIC");
4189 break;
4190 default:
4191 prefix = "???";
4192 break;
4193 }
4194
4195 return prefix;
4196}
#define gettext_noop(x)
Definition c.h:1213
#define LOG
Definition elog.h:31
#define DEBUG3
Definition elog.h:28
#define WARNING_CLIENT_ONLY
Definition elog.h:38
#define WARNING
Definition elog.h:36
#define DEBUG2
Definition elog.h:29
#define DEBUG1
Definition elog.h:30
#define NOTICE
Definition elog.h:35
#define INFO
Definition elog.h:34
#define DEBUG5
Definition elog.h:26
#define DEBUG4
Definition elog.h:27

References DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5, ERROR, FATAL, gettext_noop, INFO, LOG, LOG_SERVER_ONLY, NOTICE, PANIC, WARNING, and WARNING_CLIENT_ONLY.

Referenced by send_message_to_frontend(), send_message_to_server_log(), write_csvlog(), and write_jsonlog().

◆ errposition()

◆ errsave_finish()

void errsave_finish ( struct Node context,
const char filename,
int  lineno,
const char funcname 
)
extern

Definition at line 702 of file elog.c.

704{
705 ErrorSaveContext *escontext = (ErrorSaveContext *) context;
707
708 /* verify stack depth before accessing *edata */
710
711 /*
712 * If errsave_start punted to errstart, then elevel will be ERROR or
713 * perhaps even PANIC. Punt likewise to errfinish.
714 */
715 if (edata->elevel >= ERROR)
716 {
717 errfinish(filename, lineno, funcname);
719 }
720
721 /*
722 * Else, we should package up the stack entry contents and deliver them to
723 * the caller.
724 */
726
727 /* Save the last few bits of error state into the stack entry */
729
730 /* Replace the LOG value that errsave_start inserted */
731 edata->elevel = ERROR;
732
733 /*
734 * We skip calling backtrace and context functions, which are more likely
735 * to cause trouble than provide useful context; they might act on the
736 * assumption that a transaction abort is about to occur.
737 */
738
739 /*
740 * Make a copy of the error info for the caller. All the subsidiary
741 * strings are already in the caller's context, so it's sufficient to
742 * flat-copy the stack entry.
743 */
744 escontext->error_data = palloc_object(ErrorData);
745 memcpy(escontext->error_data, edata, sizeof(ErrorData));
746
747 /* Exit error-handling context */
750}
#define pg_unreachable()
Definition c.h:353
void errfinish(const char *filename, int lineno, const char *funcname)
Definition elog.c:485
ErrorData * error_data
Definition miscnodes.h:49

References CHECK_STACK_DEPTH, errfinish(), ERROR, ErrorSaveContext::error_data, errordata, errordata_stack_depth, fb(), filename, funcname, palloc_object, pg_unreachable, recursion_depth, and set_stack_entry_location().

◆ errsave_start()

bool errsave_start ( struct Node context,
const char domain 
)
extern

Definition at line 650 of file elog.c.

651{
652 ErrorSaveContext *escontext;
654
655 /*
656 * Do we have a context for soft error reporting? If not, just punt to
657 * errstart().
658 */
659 if (context == NULL || !IsA(context, ErrorSaveContext))
660 return errstart(ERROR, domain);
661
662 /* Report that a soft error was detected */
663 escontext = (ErrorSaveContext *) context;
664 escontext->error_occurred = true;
665
666 /* Nothing else to do if caller wants no further details */
667 if (!escontext->details_wanted)
668 return false;
669
670 /*
671 * Okay, crank up a stack entry to store the info in.
672 */
673
675
676 /* Initialize data for this error frame */
678 edata->elevel = LOG; /* signal all is well to errsave_finish */
680 /* Select default errcode based on the assumed elevel of ERROR */
681 edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
682
683 /*
684 * Any allocations for this error state level should go into the caller's
685 * context. We don't need to pollute ErrorContext, or even require it to
686 * exist, in this code path.
687 */
688 edata->assoc_context = CurrentMemoryContext;
689
691 return true;
692}
bool errstart(int elevel, const char *domain)
Definition elog.c:354
static ErrorData * get_error_stack_entry(void)
Definition elog.c:772
static void set_stack_entry_domain(ErrorData *edata, const char *domain)
Definition elog.c:799
#define IsA(nodeptr, _type_)
Definition nodes.h:164

References CurrentMemoryContext, ErrorSaveContext::details_wanted, ERROR, ErrorSaveContext::error_occurred, errstart(), fb(), get_error_stack_entry(), IsA, LOG, recursion_depth, and set_stack_entry_domain().

◆ errstart()

bool errstart ( int  elevel,
const char domain 
)
extern

Definition at line 354 of file elog.c.

355{
357 bool output_to_server;
358 bool output_to_client = false;
359 int i;
360
361 /*
362 * Check some cases in which we want to promote an error into a more
363 * severe error. None of this logic applies for non-error messages.
364 */
365 if (elevel >= ERROR)
366 {
367 /*
368 * If we are inside a critical section, all errors become PANIC
369 * errors. See miscadmin.h.
370 */
371 if (CritSectionCount > 0)
372 elevel = PANIC;
373
374 /*
375 * Check reasons for treating ERROR as FATAL:
376 *
377 * 1. we have no handler to pass the error to (implies we are in the
378 * postmaster or in backend startup).
379 *
380 * 2. ExitOnAnyError mode switch is set (initdb uses this).
381 *
382 * 3. the error occurred after proc_exit has begun to run. (It's
383 * proc_exit's responsibility to see that this doesn't turn into
384 * infinite recursion!)
385 */
386 if (elevel == ERROR)
387 {
388 if (PG_exception_stack == NULL ||
391 elevel = FATAL;
392 }
393
394 /*
395 * If the error level is ERROR or more, errfinish is not going to
396 * return to caller; therefore, if there is any stacked error already
397 * in progress it will be lost. This is more or less okay, except we
398 * do not want to have a FATAL or PANIC error downgraded because the
399 * reporting process was interrupted by a lower-grade error. So check
400 * the stack and make sure we panic if panic is warranted.
401 */
402 for (i = 0; i <= errordata_stack_depth; i++)
403 elevel = Max(elevel, errordata[i].elevel);
404 }
405
406 /*
407 * Now decide whether we need to process this report at all; if it's
408 * warning or less and not enabled for logging, just return false without
409 * starting up any error logging machinery.
410 */
411 output_to_server = should_output_to_server(elevel);
412 output_to_client = should_output_to_client(elevel);
413 if (elevel < ERROR && !output_to_server && !output_to_client)
414 return false;
415
416 /*
417 * We need to do some actual work. Make sure that memory context
418 * initialization has finished, else we can't do anything useful.
419 */
420 if (ErrorContext == NULL)
421 {
422 /* Oops, hard crash time; very little we can do safely here */
423 write_stderr("error occurred before error message processing is available\n");
424 exit(2);
425 }
426
427 /*
428 * Okay, crank up a stack entry to store the info in.
429 */
430
431 if (recursion_depth++ > 0 && elevel >= ERROR)
432 {
433 /*
434 * Oops, error during error processing. Clear ErrorContext as
435 * discussed at top of file. We will not return to the original
436 * error's reporter or handler, so we don't need it.
437 */
439
440 /*
441 * Infinite error recursion might be due to something broken in a
442 * context traceback routine. Abandon them too. We also abandon
443 * attempting to print the error statement (which, if long, could
444 * itself be the source of the recursive failure).
445 */
447 {
450 }
451 }
452
453 /* Initialize data for this error frame */
455 edata->elevel = elevel;
456 edata->output_to_server = output_to_server;
457 edata->output_to_client = output_to_client;
459 /* Select default errcode based on elevel */
460 if (elevel >= ERROR)
461 edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
462 else if (elevel >= WARNING)
463 edata->sqlerrcode = ERRCODE_WARNING;
464 else
466
467 /*
468 * Any allocations for this error state level should go into ErrorContext
469 */
470 edata->assoc_context = ErrorContext;
471
473 return true;
474}
#define Max(x, y)
Definition c.h:1013
static bool should_output_to_client(int elevel)
Definition elog.c:256
static bool should_output_to_server(int elevel)
Definition elog.c:247
bool in_error_recursion_trouble(void)
Definition elog.c:305
bool ExitOnAnyError
Definition globals.c:123
bool proc_exit_inprogress
Definition ipc.c:41
int i
Definition isn.c:77

References CritSectionCount, debug_query_string, ERROR, error_context_stack, ErrorContext, errordata, errordata_stack_depth, ExitOnAnyError, FATAL, fb(), get_error_stack_entry(), i, in_error_recursion_trouble(), Max, MemoryContextReset(), PANIC, PG_exception_stack, proc_exit_inprogress, recursion_depth, set_stack_entry_domain(), should_output_to_client(), should_output_to_server(), WARNING, and write_stderr.

Referenced by errsave_start(), errstart_cold(), and ThrowErrorData().

◆ errstart_cold()

pg_attribute_cold bool errstart_cold ( int  elevel,
const char domain 
)
extern

Definition at line 338 of file elog.c.

339{
340 return errstart(elevel, domain);
341}

References errstart().

◆ FlushErrorState()

◆ format_elog_string()

char * format_elog_string ( const char fmt,
  ... 
)
extern

◆ FreeErrorData()

void FreeErrorData ( ErrorData edata)
extern

◆ get_backend_type_for_log()

const char * get_backend_type_for_log ( void  )
extern

Definition at line 3201 of file elog.c.

3202{
3203 const char *backend_type_str;
3204
3205 if (MyProcPid == PostmasterPid)
3206 backend_type_str = "postmaster";
3207 else if (MyBackendType == B_BG_WORKER)
3208 {
3209 if (MyBgworkerEntry)
3211 else
3212 backend_type_str = "early bgworker";
3213 }
3214 else
3216
3217 return backend_type_str;
3218}
pid_t PostmasterPid
Definition globals.c:106
int MyProcPid
Definition globals.c:47
@ B_BG_WORKER
Definition miscadmin.h:346
const char * GetBackendTypeDesc(BackendType backendType)
Definition miscinit.c:263
BackendType MyBackendType
Definition miscinit.c:64
BackgroundWorker * MyBgworkerEntry
Definition postmaster.c:200
char bgw_type[BGW_MAXLEN]
Definition bgworker.h:99

References B_BG_WORKER, BackgroundWorker::bgw_type, fb(), GetBackendTypeDesc(), MyBackendType, MyBgworkerEntry, MyProcPid, and PostmasterPid.

Referenced by log_status_format(), write_csvlog(), and write_jsonlog().

◆ get_formatted_log_time()

char * get_formatted_log_time ( void  )
extern

Definition at line 3104 of file elog.c.

3105{
3107 char msbuf[13];
3108
3109 /* leave if already computed */
3110 if (formatted_log_time[0] != '\0')
3111 return formatted_log_time;
3112
3113 if (!saved_timeval_set)
3114 {
3116 saved_timeval_set = true;
3117 }
3118
3120
3121 /*
3122 * Note: we expect that guc.c will ensure that log_timezone is set up (at
3123 * least with a minimal GMT value) before Log_line_prefix can become
3124 * nonempty or CSV/JSON mode can be selected.
3125 */
3127 /* leave room for milliseconds... */
3128 "%Y-%m-%d %H:%M:%S %Z",
3130
3131 /* 'paste' milliseconds into place... */
3132 sprintf(msbuf, ".%03d", (int) (saved_timeval.tv_usec / 1000));
3134
3135 return formatted_log_time;
3136}
#define FORMATTED_TS_LEN
Definition elog.c:168
static struct timeval saved_timeval
Definition elog.c:165
int64 pg_time_t
Definition pgtime.h:23
size_t pg_strftime(char *s, size_t maxsize, const char *format, const struct pg_tm *t)
Definition strftime.c:128
struct pg_tm * pg_localtime(const pg_time_t *timep, const pg_tz *tz)
Definition localtime.c:1345
PGDLLIMPORT pg_tz * log_timezone
Definition pgtz.c:31
#define sprintf
Definition port.h:262
int gettimeofday(struct timeval *tp, void *tzp)

References fb(), formatted_log_time, FORMATTED_TS_LEN, gettimeofday(), log_timezone, pg_localtime(), pg_strftime(), saved_timeval, saved_timeval_set, and sprintf.

Referenced by log_status_format(), write_csvlog(), and write_jsonlog().

◆ get_formatted_start_time()

char * get_formatted_start_time ( void  )
extern

Definition at line 3154 of file elog.c.

3155{
3157
3158 /* leave if already computed */
3159 if (formatted_start_time[0] != '\0')
3160 return formatted_start_time;
3161
3162 /*
3163 * Note: we expect that guc.c will ensure that log_timezone is set up (at
3164 * least with a minimal GMT value) before Log_line_prefix can become
3165 * nonempty or CSV/JSON mode can be selected.
3166 */
3168 "%Y-%m-%d %H:%M:%S %Z",
3170
3171 return formatted_start_time;
3172}
static char formatted_start_time[FORMATTED_TS_LEN]
Definition elog.c:169
pg_time_t MyStartTime
Definition globals.c:48

References fb(), formatted_start_time, FORMATTED_TS_LEN, log_timezone, MyStartTime, pg_localtime(), and pg_strftime().

Referenced by log_status_format(), write_csvlog(), and write_jsonlog().

◆ geterrcode()

int geterrcode ( void  )
extern

◆ GetErrorContextStack()

char * GetErrorContextStack ( void  )
extern

Definition at line 2254 of file elog.c.

2255{
2257 ErrorContextCallback *econtext;
2258
2259 /*
2260 * Crank up a stack entry to store the info in.
2261 */
2263
2265
2266 /*
2267 * Set up assoc_context to be the caller's context, so any allocations
2268 * done (which will include edata->context) will use their context.
2269 */
2270 edata->assoc_context = CurrentMemoryContext;
2271
2272 /*
2273 * Call any context callback functions to collect the context information
2274 * into edata->context.
2275 *
2276 * Errors occurring in callback functions should go through the regular
2277 * error handling code which should handle any recursive errors, though we
2278 * double-check above, just in case.
2279 */
2280 for (econtext = error_context_stack;
2281 econtext != NULL;
2282 econtext = econtext->previous)
2283 econtext->callback(econtext->arg);
2284
2285 /*
2286 * Clean ourselves off the stack, any allocations done should have been
2287 * using edata->assoc_context, which we set up earlier to be the caller's
2288 * context, so we're free to just remove our entry off the stack and
2289 * decrement recursion depth and exit.
2290 */
2293
2294 /*
2295 * Return a pointer to the string the caller asked for, which should have
2296 * been allocated in their context.
2297 */
2298 return edata->context;
2299}

References ErrorContextCallback::arg, ErrorContextCallback::callback, CurrentMemoryContext, error_context_stack, errordata_stack_depth, fb(), get_error_stack_entry(), ErrorContextCallback::previous, and recursion_depth.

Referenced by exec_stmt_getdiag().

◆ geterrposition()

◆ getinternalerrposition()

int getinternalerrposition ( void  )
extern

◆ in_error_recursion_trouble()

bool in_error_recursion_trouble ( void  )
extern

Definition at line 305 of file elog.c.

306{
307 /* Pull the plug if recurse more than once */
308 return (recursion_depth > 2);
309}

References recursion_depth.

Referenced by err_gettext(), err_sendstring(), errstart(), pgfdw_abort_cleanup(), pgfdw_abort_cleanup_begin(), and write_console().

◆ internalerrposition()

◆ internalerrquery()

◆ log_status_format()

void log_status_format ( StringInfo  buf,
const char format,
ErrorData edata 
)
extern

Definition at line 3268 of file elog.c.

3269{
3270 /* static counter for line numbers */
3271 static long log_line_number = 0;
3272
3273 /* has counter been reset in current process? */
3274 static int log_my_pid = 0;
3275 int padding;
3276 const char *p;
3277
3278 /*
3279 * This is one of the few places where we'd rather not inherit a static
3280 * variable's value from the postmaster. But since we will, reset it when
3281 * MyProcPid changes. MyStartTime also changes when MyProcPid does, so
3282 * reset the formatted start timestamp too.
3283 */
3284 if (log_my_pid != MyProcPid)
3285 {
3286 log_line_number = 0;
3289 }
3291
3292 if (format == NULL)
3293 return; /* in case guc hasn't run yet */
3294
3295 for (p = format; *p != '\0'; p++)
3296 {
3297 if (*p != '%')
3298 {
3299 /* literal char, just copy */
3301 continue;
3302 }
3303
3304 /* must be a '%', so skip to the next char */
3305 p++;
3306 if (*p == '\0')
3307 break; /* format error - ignore it */
3308 else if (*p == '%')
3309 {
3310 /* string contains %% */
3312 continue;
3313 }
3314
3315
3316 /*
3317 * Process any formatting which may exist after the '%'. Note that
3318 * process_log_prefix_padding moves p past the padding number if it
3319 * exists.
3320 *
3321 * Note: Since only '-', '0' to '9' are valid formatting characters we
3322 * can do a quick check here to pre-check for formatting. If the char
3323 * is not formatting then we can skip a useless function call.
3324 *
3325 * Further note: At least on some platforms, passing %*s rather than
3326 * %s to appendStringInfo() is substantially slower, so many of the
3327 * cases below avoid doing that unless non-zero padding is in fact
3328 * specified.
3329 */
3330 if (*p > '9')
3331 padding = 0;
3332 else if ((p = process_log_prefix_padding(p, &padding)) == NULL)
3333 break;
3334
3335 /* process the option */
3336 switch (*p)
3337 {
3338 case 'a':
3339 if (MyProcPort)
3340 {
3341 const char *appname = application_name;
3342
3343 if (appname == NULL || *appname == '\0')
3344 appname = _("[unknown]");
3345 if (padding != 0)
3346 appendStringInfo(buf, "%*s", padding, appname);
3347 else
3348 appendStringInfoString(buf, appname);
3349 }
3350 else if (padding != 0)
3352 padding > 0 ? padding : -padding);
3353
3354 break;
3355 case 'b':
3356 {
3358
3359 if (padding != 0)
3360 appendStringInfo(buf, "%*s", padding, backend_type_str);
3361 else
3363 break;
3364 }
3365 case 'u':
3366 if (MyProcPort)
3367 {
3368 const char *username = MyProcPort->user_name;
3369
3370 if (username == NULL || *username == '\0')
3371 username = _("[unknown]");
3372 if (padding != 0)
3373 appendStringInfo(buf, "%*s", padding, username);
3374 else
3376 }
3377 else if (padding != 0)
3379 padding > 0 ? padding : -padding);
3380 break;
3381 case 'd':
3382 if (MyProcPort)
3383 {
3384 const char *dbname = MyProcPort->database_name;
3385
3386 if (dbname == NULL || *dbname == '\0')
3387 dbname = _("[unknown]");
3388 if (padding != 0)
3389 appendStringInfo(buf, "%*s", padding, dbname);
3390 else
3392 }
3393 else if (padding != 0)
3395 padding > 0 ? padding : -padding);
3396 break;
3397 case 'c':
3398 if (padding != 0)
3399 {
3400 char strfbuf[128];
3401
3402 snprintf(strfbuf, sizeof(strfbuf) - 1, "%" PRIx64 ".%x",
3404 appendStringInfo(buf, "%*s", padding, strfbuf);
3405 }
3406 else
3408 break;
3409 case 'p':
3410 if (padding != 0)
3411 appendStringInfo(buf, "%*d", padding, MyProcPid);
3412 else
3414 break;
3415
3416 case 'P':
3417 if (MyProc)
3418 {
3419 PGPROC *leader = MyProc->lockGroupLeader;
3420
3421 /*
3422 * Show the leader only for active parallel workers. This
3423 * leaves out the leader of a parallel group.
3424 */
3425 if (leader == NULL || leader->pid == MyProcPid)
3427 padding > 0 ? padding : -padding);
3428 else if (padding != 0)
3429 appendStringInfo(buf, "%*d", padding, leader->pid);
3430 else
3431 appendStringInfo(buf, "%d", leader->pid);
3432 }
3433 else if (padding != 0)
3435 padding > 0 ? padding : -padding);
3436 break;
3437
3438 case 'l':
3439 if (padding != 0)
3440 appendStringInfo(buf, "%*ld", padding, log_line_number);
3441 else
3443 break;
3444 case 'm':
3445 /* force a log timestamp reset */
3446 formatted_log_time[0] = '\0';
3448
3449 if (padding != 0)
3450 appendStringInfo(buf, "%*s", padding, formatted_log_time);
3451 else
3453 break;
3454 case 't':
3455 {
3457 char strfbuf[128];
3458
3459 pg_strftime(strfbuf, sizeof(strfbuf),
3460 "%Y-%m-%d %H:%M:%S %Z",
3462 if (padding != 0)
3463 appendStringInfo(buf, "%*s", padding, strfbuf);
3464 else
3466 }
3467 break;
3468 case 'n':
3469 {
3470 char strfbuf[128];
3471
3472 if (!saved_timeval_set)
3473 {
3475 saved_timeval_set = true;
3476 }
3477
3478 snprintf(strfbuf, sizeof(strfbuf), "%ld.%03d",
3479 (long) saved_timeval.tv_sec,
3480 (int) (saved_timeval.tv_usec / 1000));
3481
3482 if (padding != 0)
3483 appendStringInfo(buf, "%*s", padding, strfbuf);
3484 else
3486 }
3487 break;
3488 case 's':
3489 {
3491
3492 if (padding != 0)
3493 appendStringInfo(buf, "%*s", padding, start_time);
3494 else
3496 }
3497 break;
3498 case 'i':
3499 if (MyProcPort)
3500 {
3501 const char *psdisp;
3502 int displen;
3503
3505 if (padding != 0)
3506 appendStringInfo(buf, "%*s", padding, psdisp);
3507 else
3509 }
3510 else if (padding != 0)
3512 padding > 0 ? padding : -padding);
3513 break;
3514 case 'L':
3515 {
3516 const char *local_host;
3517
3518 if (MyProcPort)
3519 {
3520 if (MyProcPort->local_host[0] == '\0')
3521 {
3522 /*
3523 * First time through: cache the lookup, since it
3524 * might not have trivial cost.
3525 */
3529 sizeof(MyProcPort->local_host),
3530 NULL, 0,
3532 }
3533 local_host = MyProcPort->local_host;
3534 }
3535 else
3536 {
3537 /* Background process, or connection not yet made */
3538 local_host = "[none]";
3539 }
3540 if (padding != 0)
3541 appendStringInfo(buf, "%*s", padding, local_host);
3542 else
3543 appendStringInfoString(buf, local_host);
3544 }
3545 break;
3546 case 'r':
3548 {
3549 if (padding != 0)
3550 {
3551 if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
3552 {
3553 /*
3554 * This option is slightly special as the port
3555 * number may be appended onto the end. Here we
3556 * need to build 1 string which contains the
3557 * remote_host and optionally the remote_port (if
3558 * set) so we can properly align the string.
3559 */
3560
3561 char *hostport;
3562
3564 appendStringInfo(buf, "%*s", padding, hostport);
3565 pfree(hostport);
3566 }
3567 else
3568 appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
3569 }
3570 else
3571 {
3572 /* padding is 0, so we don't need a temp buffer */
3574 if (MyProcPort->remote_port &&
3575 MyProcPort->remote_port[0] != '\0')
3576 appendStringInfo(buf, "(%s)",
3578 }
3579 }
3580 else if (padding != 0)
3582 padding > 0 ? padding : -padding);
3583 break;
3584 case 'h':
3586 {
3587 if (padding != 0)
3588 appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
3589 else
3591 }
3592 else if (padding != 0)
3594 padding > 0 ? padding : -padding);
3595 break;
3596 case 'q':
3597 /* in postmaster and friends, stop if %q is seen */
3598 /* in a backend, just ignore */
3599 if (MyProcPort == NULL)
3600 return;
3601 break;
3602 case 'v':
3603 /* keep VXID format in sync with lockfuncs.c */
3605 {
3606 if (padding != 0)
3607 {
3608 char strfbuf[128];
3609
3610 snprintf(strfbuf, sizeof(strfbuf) - 1, "%d/%u",
3612 appendStringInfo(buf, "%*s", padding, strfbuf);
3613 }
3614 else
3616 }
3617 else if (padding != 0)
3619 padding > 0 ? padding : -padding);
3620 break;
3621 case 'x':
3622 if (padding != 0)
3623 appendStringInfo(buf, "%*u", padding, GetTopTransactionIdIfAny());
3624 else
3626 break;
3627 case 'e':
3628 if (padding != 0)
3629 appendStringInfo(buf, "%*s", padding, unpack_sql_state(edata->sqlerrcode));
3630 else
3632 break;
3633 case 'Q':
3634 if (padding != 0)
3635 appendStringInfo(buf, "%*" PRId64, padding,
3637 else
3640 break;
3641 default:
3642 /* format error - ignore it */
3643 break;
3644 }
3645 }
3646}
int64 pgstat_get_my_query_id(void)
static const char * process_log_prefix_padding(const char *p, int *ppadding)
Definition elog.c:3228
char * get_formatted_start_time(void)
Definition elog.c:3154
const char * get_backend_type_for_log(void)
Definition elog.c:3201
char * get_formatted_log_time(void)
Definition elog.c:3104
char * unpack_sql_state(int sql_state)
Definition elog.c:3653
#define _(x)
Definition elog.c:95
void reset_formatted_start_time(void)
Definition elog.c:3142
struct Port * MyProcPort
Definition globals.c:51
char * application_name
Definition guc_tables.c:570
static char * username
Definition initdb.c:153
int pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen, char *node, int nodelen, char *service, int servicelen, int flags)
Definition ip.c:117
static time_t start_time
Definition pg_ctl.c:96
#define snprintf
Definition port.h:260
#define INVALID_PROC_NUMBER
Definition procnumber.h:26
const char * get_ps_display(int *displen)
Definition ps_status.c:548
char * psprintf(const char *fmt,...)
Definition psprintf.c:43
PGPROC * MyProc
Definition proc.c:67
char * dbname
Definition streamutil.c:49
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition stringinfo.c:145
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
Definition stringinfo.c:281
void appendStringInfoSpaces(StringInfo str, int count)
Definition stringinfo.c:260
void appendStringInfoString(StringInfo str, const char *s)
Definition stringinfo.c:230
void appendStringInfoChar(StringInfo str, char ch)
Definition stringinfo.c:242
Definition proc.h:176
LocalTransactionId lxid
Definition proc.h:223
struct PGPROC::@133 vxid
ProcNumber procNumber
Definition proc.h:218
int pid
Definition proc.h:189
PGPROC * lockGroupLeader
Definition proc.h:290
char * user_name
Definition libpq-be.h:151
char * remote_port
Definition libpq-be.h:140
SockAddr laddr
Definition libpq-be.h:133
char * database_name
Definition libpq-be.h:150
char * remote_host
Definition libpq-be.h:135
char local_host[64]
Definition libpq-be.h:143
struct sockaddr_storage addr
Definition pqcomm.h:32
socklen_t salen
Definition pqcomm.h:33
TransactionId GetTopTransactionIdIfAny(void)
Definition xact.c:442

References _, SockAddr::addr, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), application_name, buf, Port::database_name, dbname, fb(), format, formatted_log_time, get_backend_type_for_log(), get_formatted_log_time(), get_formatted_start_time(), get_ps_display(), gettimeofday(), GetTopTransactionIdIfAny(), INVALID_PROC_NUMBER, Port::laddr, Port::local_host, PGPROC::lockGroupLeader, log_timezone, PGPROC::lxid, MyProc, MyProcPid, MyProcPort, MyStartTime, pfree(), pg_getnameinfo_all(), pg_localtime(), pg_strftime(), pgstat_get_my_query_id(), PGPROC::pid, process_log_prefix_padding(), PGPROC::procNumber, psprintf(), Port::remote_host, Port::remote_port, reset_formatted_start_time(), SockAddr::salen, saved_timeval, saved_timeval_set, snprintf, start_time, unpack_sql_state(), Port::user_name, username, and PGPROC::vxid.

Referenced by log_line_prefix().

◆ message_level_is_interesting()

bool message_level_is_interesting ( int  elevel)
extern

Definition at line 284 of file elog.c.

285{
286 /*
287 * Keep this in sync with the decision-making in errstart().
288 */
289 if (elevel >= ERROR ||
290 should_output_to_server(elevel) ||
292 return true;
293 return false;
294}

References ERROR, should_output_to_client(), and should_output_to_server().

Referenced by log_invalid_page(), PostmasterMain(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessWalSndrMessage(), ProcSleep(), reportDependentObjects(), ShowTransactionState(), and VacuumUpdateCosts().

◆ pg_attribute_printf()

int int int pg_attribute_printf ( ,
 
)

◆ pg_re_throw()

pg_noreturn void pg_re_throw ( void  )
extern

Definition at line 2199 of file elog.c.

2200{
2201 /* If possible, throw the error to the next outer setjmp handler */
2202 if (PG_exception_stack != NULL)
2204 else
2205 {
2206 /*
2207 * If we get here, elog(ERROR) was thrown inside a PG_TRY block, which
2208 * we have now exited only to discover that there is no outer setjmp
2209 * handler to pass the error to. Had the error been thrown outside
2210 * the block to begin with, we'd have promoted the error to FATAL, so
2211 * the correct behavior is to make it FATAL now; that is, emit it and
2212 * then call proc_exit.
2213 */
2215
2217 Assert(edata->elevel == ERROR);
2218 edata->elevel = FATAL;
2219
2220 /*
2221 * At least in principle, the increase in severity could have changed
2222 * where-to-output decisions, so recalculate.
2223 */
2224 edata->output_to_server = should_output_to_server(FATAL);
2225 edata->output_to_client = should_output_to_client(FATAL);
2226
2227 /*
2228 * We can use errfinish() for the rest, but we don't want it to call
2229 * any error context routines a second time. Since we know we are
2230 * about to exit, it should be OK to just clear the context stack.
2231 */
2233
2234 errfinish(edata->filename, edata->lineno, edata->funcname);
2235 }
2236
2237 /* Doesn't return ... */
2238 ExceptionalCondition("pg_re_throw tried to return", __FILE__, __LINE__);
2239}
void ExceptionalCondition(const char *conditionName, const char *fileName, int lineNumber)
Definition assert.c:30

References Assert, errfinish(), ERROR, error_context_stack, errordata, errordata_stack_depth, ExceptionalCondition(), FATAL, fb(), PG_exception_stack, should_output_to_client(), and should_output_to_server().

◆ pre_format_elog_string()

void pre_format_elog_string ( int  errnumber,
const char domain 
)
extern

Definition at line 1840 of file elog.c.

1841{
1842 /* Save errno before evaluation of argument functions can change it */
1844 /* Save caller's text domain */
1845 save_format_domain = domain;
1846}
static const char * save_format_domain
Definition elog.c:1837

References fb(), and save_format_domain.

◆ reset_formatted_start_time()

void reset_formatted_start_time ( void  )
extern

Definition at line 3142 of file elog.c.

3143{
3144 formatted_start_time[0] = '\0';
3145}

References formatted_start_time.

Referenced by log_status_format(), write_csvlog(), and write_jsonlog().

◆ ReThrowError()

pg_noreturn void ReThrowError ( ErrorData edata)
extern

Definition at line 2149 of file elog.c.

2150{
2152
2153 Assert(edata->elevel == ERROR);
2154
2155 /* Push the data back into the error context */
2158
2160 memcpy(newedata, edata, sizeof(ErrorData));
2161
2162 /* Make copies of separately-allocated fields */
2163 if (newedata->message)
2164 newedata->message = pstrdup(newedata->message);
2165 if (newedata->detail)
2166 newedata->detail = pstrdup(newedata->detail);
2167 if (newedata->detail_log)
2168 newedata->detail_log = pstrdup(newedata->detail_log);
2169 if (newedata->hint)
2170 newedata->hint = pstrdup(newedata->hint);
2171 if (newedata->context)
2172 newedata->context = pstrdup(newedata->context);
2173 if (newedata->backtrace)
2174 newedata->backtrace = pstrdup(newedata->backtrace);
2175 if (newedata->schema_name)
2176 newedata->schema_name = pstrdup(newedata->schema_name);
2177 if (newedata->table_name)
2178 newedata->table_name = pstrdup(newedata->table_name);
2179 if (newedata->column_name)
2180 newedata->column_name = pstrdup(newedata->column_name);
2181 if (newedata->datatype_name)
2182 newedata->datatype_name = pstrdup(newedata->datatype_name);
2183 if (newedata->constraint_name)
2184 newedata->constraint_name = pstrdup(newedata->constraint_name);
2185 if (newedata->internalquery)
2186 newedata->internalquery = pstrdup(newedata->internalquery);
2187
2188 /* Reset the assoc_context to be ErrorContext */
2189 newedata->assoc_context = ErrorContext;
2190
2192 PG_RE_THROW();
2193}

References Assert, ERROR, ErrorContext, fb(), get_error_stack_entry(), MemoryContextSwitchTo(), PG_RE_THROW, pstrdup(), and recursion_depth.

Referenced by _SPI_commit(), _SPI_rollback(), exec_stmt_block(), and exec_stmt_raise().

◆ set_errcontext_domain()

int set_errcontext_domain ( const char domain)
extern

◆ ThrowErrorData()

void ThrowErrorData ( ErrorData edata)
extern

Definition at line 2090 of file elog.c.

2091{
2093 MemoryContext oldcontext;
2094
2095 if (!errstart(edata->elevel, edata->domain))
2096 return; /* error is not to be reported at all */
2097
2100 oldcontext = MemoryContextSwitchTo(newedata->assoc_context);
2101
2102 /* Copy the supplied fields to the error stack entry. */
2103 if (edata->sqlerrcode != 0)
2104 newedata->sqlerrcode = edata->sqlerrcode;
2105 if (edata->message)
2106 newedata->message = pstrdup(edata->message);
2107 if (edata->detail)
2108 newedata->detail = pstrdup(edata->detail);
2109 if (edata->detail_log)
2110 newedata->detail_log = pstrdup(edata->detail_log);
2111 if (edata->hint)
2112 newedata->hint = pstrdup(edata->hint);
2113 if (edata->context)
2114 newedata->context = pstrdup(edata->context);
2115 if (edata->backtrace)
2116 newedata->backtrace = pstrdup(edata->backtrace);
2117 /* assume message_id is not available */
2118 if (edata->schema_name)
2119 newedata->schema_name = pstrdup(edata->schema_name);
2120 if (edata->table_name)
2121 newedata->table_name = pstrdup(edata->table_name);
2122 if (edata->column_name)
2123 newedata->column_name = pstrdup(edata->column_name);
2124 if (edata->datatype_name)
2125 newedata->datatype_name = pstrdup(edata->datatype_name);
2126 if (edata->constraint_name)
2127 newedata->constraint_name = pstrdup(edata->constraint_name);
2128 newedata->cursorpos = edata->cursorpos;
2129 newedata->internalpos = edata->internalpos;
2130 if (edata->internalquery)
2131 newedata->internalquery = pstrdup(edata->internalquery);
2132
2133 MemoryContextSwitchTo(oldcontext);
2135
2136 /* Process the error. */
2137 errfinish(edata->filename, edata->lineno, edata->funcname);
2138}

References errfinish(), errordata, errordata_stack_depth, errstart(), fb(), MemoryContextSwitchTo(), pstrdup(), and recursion_depth.

Referenced by ProcessParallelMessage(), and statatt_build_stavalues().

◆ unpack_sql_state()

char * unpack_sql_state ( int  sql_state)
extern

Definition at line 3653 of file elog.c.

3654{
3655 static char buf[12];
3656 int i;
3657
3658 for (i = 0; i < 5; i++)
3659 {
3661 sql_state >>= 6;
3662 }
3663
3664 buf[i] = '\0';
3665 return buf;
3666}
#define PGUNSIXBIT(val)
Definition elog.h:54

References buf, fb(), i, and PGUNSIXBIT.

Referenced by exec_stmt_block(), exec_stmt_getdiag(), exec_stmt_raise(), log_status_format(), pg_input_error_info(), pltcl_construct_errorCode(), PLy_exception_set_with_details(), PLy_generate_spi_exceptions(), send_message_to_frontend(), send_message_to_server_log(), write_csvlog(), and write_jsonlog().

◆ vwrite_stderr()

void void vwrite_stderr ( const char fmt,
va_list  ap 
)
extern

◆ write_csvlog()

void write_csvlog ( ErrorData edata)
extern

Definition at line 63 of file csvlog.c.

64{
66 bool print_stmt = false;
67
68 /* static counter for line numbers */
69 static long log_line_number = 0;
70
71 /* has counter been reset in current process? */
72 static int log_my_pid = 0;
73
74 /*
75 * This is one of the few places where we'd rather not inherit a static
76 * variable's value from the postmaster. But since we will, reset it when
77 * MyProcPid changes.
78 */
79 if (log_my_pid != MyProcPid)
80 {
84 }
86
88
89 /* timestamp with milliseconds */
92
93 /* username */
94 if (MyProcPort)
97
98 /* database name */
99 if (MyProcPort)
102
103 /* Process id */
104 if (MyProcPid != 0)
107
108 /* Remote host and port */
110 {
113 if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
114 {
117 }
119 }
121
122 /* session id */
125
126 /* Line number */
129
130 /* PS display */
131 if (MyProcPort)
132 {
134 const char *psdisp;
135 int displen;
136
138
142
143 pfree(msgbuf.data);
144 }
146
147 /* session start timestamp */
150
151 /* Virtual transaction id */
152 /* keep VXID format in sync with lockfuncs.c */
156
157 /* Transaction id */
160
161 /* Error severity */
164
165 /* SQL state code */
168
169 /* errmessage */
170 appendCSVLiteral(&buf, edata->message);
172
173 /* errdetail or errdetail_log */
174 if (edata->detail_log)
175 appendCSVLiteral(&buf, edata->detail_log);
176 else
177 appendCSVLiteral(&buf, edata->detail);
179
180 /* errhint */
181 appendCSVLiteral(&buf, edata->hint);
183
184 /* internal query */
185 appendCSVLiteral(&buf, edata->internalquery);
187
188 /* if printed internal query, print internal pos too */
189 if (edata->internalpos > 0 && edata->internalquery != NULL)
190 appendStringInfo(&buf, "%d", edata->internalpos);
192
193 /* errcontext */
194 if (!edata->hide_ctx)
195 appendCSVLiteral(&buf, edata->context);
197
198 /* user query --- only reported if not disabled by the caller */
200 if (print_stmt)
203 if (print_stmt && edata->cursorpos > 0)
204 appendStringInfo(&buf, "%d", edata->cursorpos);
206
207 /* file error location */
209 {
211
213
214 if (edata->funcname && edata->filename)
215 appendStringInfo(&msgbuf, "%s, %s:%d",
216 edata->funcname, edata->filename,
217 edata->lineno);
218 else if (edata->filename)
219 appendStringInfo(&msgbuf, "%s:%d",
220 edata->filename, edata->lineno);
222 pfree(msgbuf.data);
223 }
225
226 /* application name */
229
231
232 /* backend type */
235
236 /* leader PID */
237 if (MyProc)
238 {
239 PGPROC *leader = MyProc->lockGroupLeader;
240
241 /*
242 * Show the leader only for active parallel workers. This leaves out
243 * the leader of a parallel group.
244 */
245 if (leader && leader->pid != MyProcPid)
246 appendStringInfo(&buf, "%d", leader->pid);
247 }
249
250 /* query id */
252
254
255 /* If in the syslogger process, try to write messages direct to file */
256 if (MyBackendType == B_LOGGER)
258 else
260
261 pfree(buf.data);
262}
static void appendCSVLiteral(StringInfo buf, const char *data)
Definition csvlog.c:37
bool check_log_of_query(ErrorData *edata)
Definition elog.c:3178
const char * error_severity(int elevel)
Definition elog.c:4154
int Log_error_verbosity
Definition elog.c:113
void write_pipe_chunks(char *data, int len, int dest)
Definition elog.c:3913
#define LOG_DESTINATION_CSVLOG
Definition elog.h:488
@ B_LOGGER
Definition miscadmin.h:374
void initStringInfo(StringInfo str)
Definition stringinfo.c:97
void write_syslogger_file(const char *buffer, int count, int destination)
Definition syslogger.c:1092

References _, appendBinaryStringInfo(), appendCSVLiteral(), appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), application_name, B_LOGGER, buf, check_log_of_query(), Port::database_name, debug_query_string, error_severity(), fb(), get_backend_type_for_log(), get_formatted_log_time(), get_formatted_start_time(), get_ps_display(), GetTopTransactionIdIfAny(), initStringInfo(), INVALID_PROC_NUMBER, PGPROC::lockGroupLeader, LOG_DESTINATION_CSVLOG, Log_error_verbosity, PGPROC::lxid, MyBackendType, MyProc, MyProcPid, MyProcPort, MyStartTime, pfree(), PGERROR_VERBOSE, pgstat_get_my_query_id(), PGPROC::pid, PGPROC::procNumber, Port::remote_host, Port::remote_port, reset_formatted_start_time(), unpack_sql_state(), Port::user_name, PGPROC::vxid, write_pipe_chunks(), and write_syslogger_file().

Referenced by send_message_to_server_log().

◆ write_jsonlog()

void write_jsonlog ( ErrorData edata)
extern

Definition at line 109 of file jsonlog.c.

110{
112 char *start_time;
113 char *log_time;
114
115 /* static counter for line numbers */
116 static long log_line_number = 0;
117
118 /* Has the counter been reset in the current process? */
119 static int log_my_pid = 0;
120
121 /*
122 * This is one of the few places where we'd rather not inherit a static
123 * variable's value from the postmaster. But since we will, reset it when
124 * MyProcPid changes.
125 */
126 if (log_my_pid != MyProcPid)
127 {
128 log_line_number = 0;
131 }
133
135
136 /* Initialize string */
138
139 /* timestamp with milliseconds */
141
142 /*
143 * First property does not use appendJSONKeyValue as it does not have
144 * comma prefix.
145 */
146 escape_json(&buf, "timestamp");
149
150 /* username */
151 if (MyProcPort)
152 appendJSONKeyValue(&buf, "user", MyProcPort->user_name, true);
153
154 /* database name */
155 if (MyProcPort)
157
158 /* Process ID */
159 if (MyProcPid != 0)
160 appendJSONKeyValueFmt(&buf, "pid", false, "%d", MyProcPid);
161
162 /* Remote host and port */
164 {
165 appendJSONKeyValue(&buf, "remote_host", MyProcPort->remote_host, true);
166 if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
167 appendJSONKeyValue(&buf, "remote_port", MyProcPort->remote_port, false);
168 }
169
170 /* Session id */
171 appendJSONKeyValueFmt(&buf, "session_id", true, "%" PRIx64 ".%x",
173
174 /* Line number */
175 appendJSONKeyValueFmt(&buf, "line_num", false, "%ld", log_line_number);
176
177 /* PS display */
178 if (MyProcPort)
179 {
181 const char *psdisp;
182 int displen;
183
187 appendJSONKeyValue(&buf, "ps", msgbuf.data, true);
188
189 pfree(msgbuf.data);
190 }
191
192 /* session start timestamp */
194 appendJSONKeyValue(&buf, "session_start", start_time, true);
195
196 /* Virtual transaction id */
197 /* keep VXID format in sync with lockfuncs.c */
199 appendJSONKeyValueFmt(&buf, "vxid", true, "%d/%u",
201
202 /* Transaction id */
203 appendJSONKeyValueFmt(&buf, "txid", false, "%u",
205
206 /* Error severity */
207 if (edata->elevel)
208 appendJSONKeyValue(&buf, "error_severity",
209 error_severity(edata->elevel), true);
210
211 /* SQL state code */
212 if (edata->sqlerrcode)
213 appendJSONKeyValue(&buf, "state_code",
214 unpack_sql_state(edata->sqlerrcode), true);
215
216 /* errmessage */
217 appendJSONKeyValue(&buf, "message", edata->message, true);
218
219 /* errdetail or error_detail log */
220 if (edata->detail_log)
221 appendJSONKeyValue(&buf, "detail", edata->detail_log, true);
222 else
223 appendJSONKeyValue(&buf, "detail", edata->detail, true);
224
225 /* errhint */
226 if (edata->hint)
227 appendJSONKeyValue(&buf, "hint", edata->hint, true);
228
229 /* internal query */
230 if (edata->internalquery)
231 appendJSONKeyValue(&buf, "internal_query", edata->internalquery,
232 true);
233
234 /* if printed internal query, print internal pos too */
235 if (edata->internalpos > 0 && edata->internalquery != NULL)
236 appendJSONKeyValueFmt(&buf, "internal_position", false, "%d",
237 edata->internalpos);
238
239 /* errcontext */
240 if (edata->context && !edata->hide_ctx)
241 appendJSONKeyValue(&buf, "context", edata->context, true);
242
243 /* user query --- only reported if not disabled by the caller */
245 {
246 appendJSONKeyValue(&buf, "statement", debug_query_string, true);
247 if (edata->cursorpos > 0)
248 appendJSONKeyValueFmt(&buf, "cursor_position", false, "%d",
249 edata->cursorpos);
250 }
251
252 /* file error location */
254 {
255 if (edata->funcname)
256 appendJSONKeyValue(&buf, "func_name", edata->funcname, true);
257 if (edata->filename)
258 {
259 appendJSONKeyValue(&buf, "file_name", edata->filename, true);
260 appendJSONKeyValueFmt(&buf, "file_line_num", false, "%d",
261 edata->lineno);
262 }
263 }
264
265 /* Application name */
266 if (application_name && application_name[0] != '\0')
267 appendJSONKeyValue(&buf, "application_name", application_name, true);
268
269 /* backend type */
270 appendJSONKeyValue(&buf, "backend_type", get_backend_type_for_log(), true);
271
272 /* leader PID */
273 if (MyProc)
274 {
275 PGPROC *leader = MyProc->lockGroupLeader;
276
277 /*
278 * Show the leader only for active parallel workers. This leaves out
279 * the leader of a parallel group.
280 */
281 if (leader && leader->pid != MyProcPid)
282 appendJSONKeyValueFmt(&buf, "leader_pid", false, "%d",
283 leader->pid);
284 }
285
286 /* query id */
287 appendJSONKeyValueFmt(&buf, "query_id", false, "%" PRId64,
289
290 /* Finish string */
293
294 /* If in the syslogger process, try to write messages direct to file */
295 if (MyBackendType == B_LOGGER)
297 else
299
300 pfree(buf.data);
301}
#define LOG_DESTINATION_JSONLOG
Definition elog.h:489
void escape_json(StringInfo buf, const char *str)
Definition json.c:1604
static void static void appendJSONKeyValue(StringInfo buf, const char *key, const char *value, bool escape_value)
Definition jsonlog.c:43
static void appendJSONKeyValueFmt(StringInfo buf, const char *key, bool escape_key, const char *fmt,...) pg_attribute_printf(4
Definition jsonlog.c:70

References appendBinaryStringInfo(), appendJSONKeyValue(), appendJSONKeyValueFmt(), appendStringInfoChar(), application_name, B_LOGGER, buf, check_log_of_query(), Port::database_name, debug_query_string, error_severity(), escape_json(), fb(), get_backend_type_for_log(), get_formatted_log_time(), get_formatted_start_time(), get_ps_display(), GetTopTransactionIdIfAny(), initStringInfo(), INVALID_PROC_NUMBER, PGPROC::lockGroupLeader, LOG_DESTINATION_JSONLOG, Log_error_verbosity, PGPROC::lxid, MyBackendType, MyProc, MyProcPid, MyProcPort, MyStartTime, pfree(), PGERROR_VERBOSE, pgstat_get_my_query_id(), PGPROC::pid, PGPROC::procNumber, Port::remote_host, Port::remote_port, reset_formatted_start_time(), start_time, unpack_sql_state(), Port::user_name, PGPROC::vxid, write_pipe_chunks(), and write_syslogger_file().

Referenced by send_message_to_server_log().

◆ write_pipe_chunks()

void write_pipe_chunks ( char data,
int  len,
int  dest 
)
extern

Definition at line 3913 of file elog.c.

3914{
3916 int fd = fileno(stderr);
3917 int rc;
3918
3919 Assert(len > 0);
3920
3921 p.proto.nuls[0] = p.proto.nuls[1] = '\0';
3922 p.proto.pid = MyProcPid;
3923 p.proto.flags = 0;
3924 if (dest == LOG_DESTINATION_STDERR)
3926 else if (dest == LOG_DESTINATION_CSVLOG)
3928 else if (dest == LOG_DESTINATION_JSONLOG)
3930
3931 /* write all but the last chunk */
3932 while (len > PIPE_MAX_PAYLOAD)
3933 {
3934 /* no need to set PIPE_PROTO_IS_LAST yet */
3938 (void) rc;
3941 }
3942
3943 /* write the last chunk */
3945 p.proto.len = len;
3946 memcpy(p.proto.data, data, len);
3947 rc = write(fd, &p, PIPE_HEADER_SIZE + len);
3948 (void) rc;
3949}
#define LOG_DESTINATION_STDERR
Definition elog.h:485
#define write(a, b, c)
Definition win32.h:14
char data[FLEXIBLE_ARRAY_MEMBER]
Definition syslogger.h:50
#define PIPE_PROTO_DEST_JSONLOG
Definition syslogger.h:67
#define PIPE_PROTO_IS_LAST
Definition syslogger.h:63
#define PIPE_PROTO_DEST_CSVLOG
Definition syslogger.h:66
#define PIPE_PROTO_DEST_STDERR
Definition syslogger.h:65
#define PIPE_MAX_PAYLOAD
Definition syslogger.h:60
#define PIPE_HEADER_SIZE
Definition syslogger.h:59
PipeProtoHeader proto
Definition syslogger.h:55

References Assert, PipeProtoHeader::data, data, fb(), fd(), PipeProtoHeader::flags, PipeProtoHeader::len, len, LOG_DESTINATION_CSVLOG, LOG_DESTINATION_JSONLOG, LOG_DESTINATION_STDERR, MyProcPid, PipeProtoHeader::nuls, PipeProtoHeader::pid, PIPE_HEADER_SIZE, PIPE_MAX_PAYLOAD, PIPE_PROTO_DEST_CSVLOG, PIPE_PROTO_DEST_JSONLOG, PIPE_PROTO_DEST_STDERR, PIPE_PROTO_IS_LAST, PipeProtoChunk::proto, and write.

Referenced by send_message_to_server_log(), write_csvlog(), and write_jsonlog().

◆ write_stderr()

void write_stderr ( const char fmt,
  ... 
)
extern

Variable Documentation

◆ emit_log_hook

PGDLLIMPORT emit_log_hook_type emit_log_hook
extern

Definition at line 110 of file elog.c.

Referenced by EmitErrorReport().

◆ error_context_stack

PGDLLIMPORT ErrorContextCallback* error_context_stack
extern

Definition at line 99 of file elog.c.

Referenced by _SPI_execute_plan(), _SPI_prepare_oneshot_plan(), _SPI_prepare_plan(), ApplyWalRecord(), AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWorkerMain(), BackgroundWriterMain(), begin_cb_wrapper(), begin_prepare_cb_wrapper(), call_pltcl_start_proc(), cancel_parser_errposition_callback(), cancel_scanner_errposition_callback(), change_cb_wrapper(), CheckpointerMain(), commit_cb_wrapper(), commit_prepared_cb_wrapper(), compile_plperl_function(), CopyFrom(), CreateParallelContext(), errfinish(), errstart(), exec_bind_message(), exec_execute_message(), execute_sql_string(), file_acquire_sample_rows(), fileIterateForeignScan(), filter_by_origin_cb_wrapper(), filter_prepare_cb_wrapper(), FlushBuffer(), FlushRelationBuffers(), fmgr_sql(), fmgr_sql_validator(), GetErrorContextStack(), heap_vacuum_rel(), ImportForeignSchema(), inline_function(), inline_function_in_from(), IoWorkerMain(), LogicalParallelApplyLoop(), LogicalRepApplyLoop(), make_tuple_from_result_row(), message_cb_wrapper(), parallel_vacuum_main(), pg_re_throw(), pgarch_archiveXlog(), plperl_event_trigger_handler(), plperl_func_handler(), plperl_inline_handler(), plperl_trigger_handler(), plpgsql_compile_callback(), plpgsql_compile_inline(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_trigger(), plpython3_call_handler(), plpython3_inline_handler(), PLy_exec_function(), PLy_modify_tuple(), PostgresMain(), prepare_cb_wrapper(), proc_exit_prepare(), ProcessParallelApplyMessage(), ProcessParallelMessage(), quickdie(), ReindexPartitions(), ReplSlotSyncWorkerMain(), RestoreGUCState(), rollback_prepared_cb_wrapper(), setup_parser_errposition_callback(), setup_scanner_errposition_callback(), shutdown_cb_wrapper(), SPI_cursor_open_internal(), SPI_plan_get_cached_plan(), sql_compile_callback(), startup_cb_wrapper(), stream_abort_cb_wrapper(), stream_change_cb_wrapper(), stream_commit_cb_wrapper(), stream_message_cb_wrapper(), stream_prepare_cb_wrapper(), stream_start_cb_wrapper(), stream_stop_cb_wrapper(), stream_truncate_cb_wrapper(), tokenize_auth_file(), truncate_cb_wrapper(), tsearch_readline_begin(), tsearch_readline_end(), typeStringToTypeName(), update_progress_txn_cb_wrapper(), WaitOnLock(), WalSummarizerMain(), WalWriterMain(), and XactLockTableWait().

◆ Log_destination

◆ Log_destination_string

PGDLLIMPORT char* Log_destination_string
extern

Definition at line 116 of file elog.c.

Referenced by PostmasterMain().

◆ Log_error_verbosity

PGDLLIMPORT int Log_error_verbosity
extern

Definition at line 113 of file elog.c.

Referenced by send_message_to_server_log(), write_csvlog(), and write_jsonlog().

◆ Log_line_prefix

PGDLLIMPORT char* Log_line_prefix
extern

Definition at line 114 of file elog.c.

Referenced by log_line_prefix().

◆ PG_exception_stack

◆ syslog_sequence_numbers

PGDLLIMPORT bool syslog_sequence_numbers
extern

Definition at line 117 of file elog.c.

◆ syslog_split_messages

PGDLLIMPORT bool syslog_split_messages
extern

Definition at line 118 of file elog.c.