PostgreSQL Source Code  git master
elog.c File Reference
#include "postgres.h"
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
#include "access/transam.h"
#include "access/xact.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "postmaster/postmaster.h"
#include "postmaster/syslogger.h"
#include "storage/ipc.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
Include dependency graph for elog.c:

Go to the source code of this file.

Macros

#define _(x)   err_gettext(x)
 
#define ERRORDATA_STACK_SIZE   5
 
#define FORMATTED_TS_LEN   128
 
#define CHECK_STACK_DEPTH()
 
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
 
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
 

Functions

static const char * err_gettext (const char *str) pg_attribute_format_arg(1)
 
static void set_errdata_field (MemoryContextData *cxt, char **ptr, const char *str)
 
static void write_console (const char *line, int len)
 
static void setup_formatted_log_time (void)
 
static void setup_formatted_start_time (void)
 
static const char * process_log_prefix_padding (const char *p, int *padding)
 
static void log_line_prefix (StringInfo buf, ErrorData *edata)
 
static void write_csvlog (ErrorData *edata)
 
static void send_message_to_server_log (ErrorData *edata)
 
static void write_pipe_chunks (char *data, int len, int dest)
 
static void send_message_to_frontend (ErrorData *edata)
 
static char * expand_fmt_string (const char *fmt, ErrorData *edata)
 
static const char * useful_strerror (int errnum)
 
static const char * get_errno_symbol (int errnum)
 
static const char * error_severity (int elevel)
 
static void append_with_tabs (StringInfo buf, const char *str)
 
static bool is_log_level_output (int elevel, int log_min_level)
 
bool in_error_recursion_trouble (void)
 
bool errstart (int elevel, const char *filename, int lineno, const char *funcname, const char *domain)
 
void errfinish (int dummy,...)
 
int errcode (int sqlerrcode)
 
int errcode_for_file_access (void)
 
int errcode_for_socket_access (void)
 
int errmsg (const char *fmt,...)
 
int errmsg_internal (const char *fmt,...)
 
int errmsg_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errdetail (const char *fmt,...)
 
int errdetail_internal (const char *fmt,...)
 
int errdetail_log (const char *fmt,...)
 
int errdetail_log_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errdetail_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errhint (const char *fmt,...)
 
int errcontext_msg (const char *fmt,...)
 
int set_errcontext_domain (const char *domain)
 
int errhidestmt (bool hide_stmt)
 
int errhidecontext (bool hide_ctx)
 
int errfunction (const char *funcname)
 
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)
 
void elog_start (const char *filename, int lineno, const char *funcname)
 
void elog_finish (int elevel, const char *fmt,...)
 
void pre_format_elog_string (int errnumber, const char *domain)
 
char * format_elog_string (const char *fmt,...)
 
void EmitErrorReport (void)
 
ErrorDataCopyErrorData (void)
 
void FreeErrorData (ErrorData *edata)
 
void FlushErrorState (void)
 
void ThrowErrorData (ErrorData *edata)
 
void ReThrowError (ErrorData *edata)
 
void pg_re_throw (void)
 
char * GetErrorContextStack (void)
 
void DebugFileOpen (void)
 
static void appendCSVLiteral (StringInfo buf, const char *data)
 
char * unpack_sql_state (int sql_state)
 
static void err_sendstring (StringInfo buf, const char *str)
 
void write_stderr (const char *fmt,...)
 
int trace_recovery (int trace_level)
 

Variables

ErrorContextCallbackerror_context_stack = NULL
 
sigjmp_buf * PG_exception_stack = NULL
 
bool redirection_done
 
emit_log_hook_type emit_log_hook = NULL
 
int Log_error_verbosity = PGERROR_VERBOSE
 
char * Log_line_prefix = NULL
 
int Log_destination = LOG_DESTINATION_STDERR
 
char * Log_destination_string = NULL
 
bool syslog_sequence_numbers = true
 
bool syslog_split_messages = true
 
static ErrorData errordata [ERRORDATA_STACK_SIZE]
 
static int errordata_stack_depth = -1
 
static int recursion_depth = 0
 
static struct timeval saved_timeval
 
static bool saved_timeval_set = false
 
static char formatted_start_time [FORMATTED_TS_LEN]
 
static char formatted_log_time [FORMATTED_TS_LEN]
 
static int save_format_errnumber
 
static const char * save_format_domain
 

Macro Definition Documentation

◆ _

#define _ (   x)    err_gettext(x)

Definition at line 84 of file elog.c.

Referenced by abbroffset(), add_tablespace_footer(), addtype(), adjleap(), adjust_data_dir(), advice(), appendPsqlMetaConnect(), appendShellString(), associate(), ATWrongRelkindError(), auth_failed(), BaseBackup(), bootstrap_template1(), byword(), change_directory(), check_agglevels_and_constraints(), check_authmethod_unspecified(), check_authmethod_valid(), check_input(), check_loadable_libraries(), check_locale_encoding(), check_locale_name(), check_need_password(), check_ok(), check_srf_call_placement(), CheckCopyStreamStop(), CheckDataVersion(), CheckSCRAMAuth(), CheckServerVersionForStreaming(), cleanup_directories_atexit(), CleanupBackend(), CleanupBackgroundWorker(), CleanupPriorWALFiles(), ClientAuthentication(), close_destination_dir(), close_file(), close_walfile(), ClosePager(), cluster_all_databases(), cluster_one_database(), componentcheck(), connectDatabase(), connection_warnings(), connectToServer(), convert_sourcefiles_in(), convert_tuples_by_name_map(), convert_tuples_by_position(), ConvertTriggerToFK(), CopyStreamPoll(), CopyStreamReceive(), create_data_directory(), create_database(), create_role(), create_xlog_or_symlink(), CreateReplicationSlot(), CustomizableNextWALFileReady(), dbState(), DeadLockReport(), describeAccessMethods(), describeAggregates(), describeFunctions(), DescribeLockTag(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTablespaces(), describeTypes(), die(), do_advice(), do_connect(), do_help(), do_init(), do_kill(), do_lo_list(), do_promote(), do_reload(), do_restart(), do_start(), do_status(), do_stop(), do_watch(), dolink(), drop_database_if_exists(), drop_role_if_exists(), DropErrorMsgWrongType(), DropReplicationSlot(), dumpCreateDB(), dumpDatabases(), dumpRoles(), dumpTablespaces(), durable_rename(), echo_hidden_command(), ecpg_start_test(), escape_quotes(), exec_command_cd(), exec_command_conninfo(), exec_command_ef_ev(), exec_command_errverbose(), exec_command_print(), exec_command_reset(), exec_command_s(), exec_command_timing(), exec_execute_message(), executeCommand(), executeQuery(), executeQueryOrDie(), fatal_error(), file_line_count(), file_size(), find_my_exec(), find_other_exec_or_die(), FindEndOfXLOG(), FindStreamingStart(), fsync_fname(), fsync_pgdata(), GenerateRecoveryConf(), get_configdata(), get_control_dbstate(), get_controlfile(), get_destination_dir(), get_encoding_id(), get_id(), get_opts(), get_pgpid(), get_restricted_token(), get_role_password(), get_su_pwd(), get_user_name(), GetConnection(), getfields(), gethms(), getObjectDescription(), getObjectIdentityParts(), getOpFamilyDescription(), GetQueryResult(), getRelationDescription(), growalloc(), handle_args(), handle_sigint(), handleCopyIn(), HandleCopyStream(), HandleEndOfCopyStream(), HandleParallelMessage(), help(), helpSQL(), helpVariables(), ident_inet(), incompatible_module_error(), infile(), init_parallel_dump_utils(), init_slot(), Initialize(), initialize_data_directory(), initialize_environment(), inleap(), inlink(), inrule(), inzcont(), inzone(), inzsub(), isolation_init(), isolation_start_test(), KillExistingArchiveStatus(), KillExistingXLOG(), lazy_scan_heap(), lazy_vacuum_rel(), leapadd(), libpqrcv_exec(), libpqrcv_get_conninfo(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listOneExtensionContents(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSDictionaries(), listTSParsers(), listTSTemplates(), listUserMappings(), load_resultmap(), log_child_failure(), log_line_prefix(), LogStreamerMain(), main(), MainLoop(), make_absolute_path(), make_directory(), mark_file_as_archived(), md5_crypt_verify(), memory_exhausted(), mkdirs(), namecheck(), newabbr(), objectDescription(), open_result_files(), open_walfile(), output(), OutputFsync(), outzone(), parse_and_validate_value(), parse_max_rate(), parse_psql_options(), parseCommandLine(), pclose_check(), PerformAuthentication(), permissionsList(), pg_attribute_printf(), pg_attribute_unused(), pg_be_scram_init(), pg_fatal(), pg_get_keywords(), pg_log_v(), pg_malloc_internal(), pg_realloc(), pg_rusage_show(), pg_strdup(), pgbench_error(), pgfnames(), pgwin32_is_admin(), plain_crypt_verify(), plpgsql_exec_error_callback(), plpgsql_stmt_typename(), plpgsql_yyerror(), popen_check(), print_elapse(), PrintControlValues(), printMixedStruct(), PrintNewControlValues(), PrintNotifications(), printPsetInfo(), printSSLInfo(), printTable(), printTableAddCell(), printTableAddHeader(), PrintTiming(), process_psqlrc(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), ProcSleep(), prompt_for_password(), psql_command(), psql_error(), psql_start_test(), PSQLexec(), PSQLexecWatch(), pvsnprintf(), reached_end_position(), read_post_opts(), ReadControlFile(), ReadEndOfStreamingResult(), readfile(), readRecoveryCommandFile(), reaper(), ReceiveAndUnpackTarFile(), ReceiveTarFile(), ReceiveXlogStream(), regression_main(), reindex_all_databases(), reindex_one_database(), reindex_system_catalogs(), report_fork_failure_to_client(), report_invalid_record(), report_unmatched_relation(), reportDependentObjects(), resolve_symlinks(), results_differ(), RetrieveWalSegSize(), rewind_parseTimeLineHistory(), RewriteControlFile(), rewriteTargetView(), rmtree(), rpytime(), rulesub(), run_diff(), run_schedule(), run_single_test(), run_vacuum_command(), RunIdentifySystem(), runPgDump(), send_message_to_frontend(), send_message_to_server_log(), sendFeedback(), SendQuery(), set_dump_section(), set_mode(), set_null_conf(), set_sig(), setup_bin_paths(), setup_cancel_handler(), setup_config(), setup_locale_encoding(), setup_pgdata(), setup_text_search(), SetWALFileNameForCleanup(), simple_prompt(), SimpleXLogPageRead(), size_product(), slashUsage(), spawn_process(), SSLerrmessage(), start_postmaster(), StartLogStreamer(), stop_postmaster(), stop_streaming(), storeObjectDescription(), StreamLog(), StreamLogicalLog(), StreamServerPort(), strerror(), tablespace_list_append(), test_config_settings(), test_file_descriptor_sync(), test_non_sync(), test_open_sync(), test_open_syncs(), test_sync(), test_timing(), time_overflow(), transformSubLink(), transformWindowFuncCall(), usage(), useful_strerror(), vacuum_one_database(), verify_dir_is_empty_or_create(), verror(), vwrite_msg(), wait_for_postmaster(), wait_for_tests(), wait_result_to_str(), wal_level_str(), walkdir(), warn_on_mount_point(), warning(), write_csvlog(), write_stderr(), write_version_file(), WriteEmptyXLOG(), writefile(), WriteRecoveryConf(), writeTarData(), writeTimeLineHistoryFile(), writezone(), yearistype(), and yesno_prompt().

◆ CHECK_STACK_DEPTH

◆ ERRORDATA_STACK_SIZE

#define ERRORDATA_STACK_SIZE   5

Definition at line 138 of file elog.c.

Referenced by elog_start(), errstart(), GetErrorContextStack(), and ReThrowError().

◆ EVALUATE_MESSAGE

#define EVALUATE_MESSAGE (   domain,
  targetfield,
  appendval,
  translateit 
)

◆ EVALUATE_MESSAGE_PLURAL

#define EVALUATE_MESSAGE_PLURAL (   domain,
  targetfield,
  appendval 
)

Definition at line 748 of file elog.c.

Referenced by errdetail_log_plural(), errdetail_plural(), and errmsg_plural().

◆ FORMATTED_TS_LEN

#define FORMATTED_TS_LEN   128

Definition at line 153 of file elog.c.

Referenced by setup_formatted_log_time(), and setup_formatted_start_time().

Function Documentation

◆ append_with_tabs()

static void append_with_tabs ( StringInfo  buf,
const char *  str 
)
static

Definition at line 3657 of file elog.c.

References appendStringInfoCharMacro.

Referenced by send_message_to_server_log().

3658 {
3659  char ch;
3660 
3661  while ((ch = *str++) != '\0')
3662  {
3663  appendStringInfoCharMacro(buf, ch);
3664  if (ch == '\n')
3665  appendStringInfoCharMacro(buf, '\t');
3666  }
3667 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:127

◆ appendCSVLiteral()

static void appendCSVLiteral ( StringInfo  buf,
const char *  data 
)
inlinestatic

Definition at line 2628 of file elog.c.

References appendStringInfoCharMacro.

Referenced by write_csvlog().

2629 {
2630  const char *p = data;
2631  char c;
2632 
2633  /* avoid confusing an empty string with NULL */
2634  if (p == NULL)
2635  return;
2636 
2637  appendStringInfoCharMacro(buf, '"');
2638  while ((c = *p++) != '\0')
2639  {
2640  if (c == '"')
2641  appendStringInfoCharMacro(buf, '"');
2642  appendStringInfoCharMacro(buf, c);
2643  }
2644  appendStringInfoCharMacro(buf, '"');
2645 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:127
char * c

◆ CopyErrorData()

ErrorData* CopyErrorData ( void  )

Definition at line 1497 of file elog.c.

References Assert, ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, CurrentMemoryContext, ErrorData::datatype_name, ErrorData::detail, ErrorData::detail_log, ErrorContext, errordata_stack_depth, ErrorData::hint, ErrorData::internalquery, ErrorData::message, palloc(), pstrdup(), ErrorData::schema_name, and ErrorData::table_name.

Referenced by exec_stmt_block(), initTrie(), plperl_return_next(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_util_elog(), pltcl_elog(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), and xml_is_document().

1498 {
1500  ErrorData *newedata;
1501 
1502  /*
1503  * we don't increment recursion_depth because out-of-memory here does not
1504  * indicate a problem within the error subsystem.
1505  */
1507 
1509 
1510  /* Copy the struct itself */
1511  newedata = (ErrorData *) palloc(sizeof(ErrorData));
1512  memcpy(newedata, edata, sizeof(ErrorData));
1513 
1514  /* Make copies of separately-allocated fields */
1515  if (newedata->message)
1516  newedata->message = pstrdup(newedata->message);
1517  if (newedata->detail)
1518  newedata->detail = pstrdup(newedata->detail);
1519  if (newedata->detail_log)
1520  newedata->detail_log = pstrdup(newedata->detail_log);
1521  if (newedata->hint)
1522  newedata->hint = pstrdup(newedata->hint);
1523  if (newedata->context)
1524  newedata->context = pstrdup(newedata->context);
1525  if (newedata->schema_name)
1526  newedata->schema_name = pstrdup(newedata->schema_name);
1527  if (newedata->table_name)
1528  newedata->table_name = pstrdup(newedata->table_name);
1529  if (newedata->column_name)
1530  newedata->column_name = pstrdup(newedata->column_name);
1531  if (newedata->datatype_name)
1532  newedata->datatype_name = pstrdup(newedata->datatype_name);
1533  if (newedata->constraint_name)
1534  newedata->constraint_name = pstrdup(newedata->constraint_name);
1535  if (newedata->internalquery)
1536  newedata->internalquery = pstrdup(newedata->internalquery);
1537 
1538  /* Use the calling context for string allocation */
1539  newedata->assoc_context = CurrentMemoryContext;
1540 
1541  return newedata;
1542 }
char * schema_name
Definition: elog.h:349
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
MemoryContext ErrorContext
Definition: mcxt.c:44
char * pstrdup(const char *in)
Definition: mcxt.c:1063
char * internalquery
Definition: elog.h:356
static int errordata_stack_depth
Definition: elog.c:142
char * detail_log
Definition: elog.h:345
char * table_name
Definition: elog.h:350
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
char * datatype_name
Definition: elog.h:352
char * detail
Definition: elog.h:344
char * column_name
Definition: elog.h:351
#define Assert(condition)
Definition: c.h:680
char * hint
Definition: elog.h:346
char * context
Definition: elog.h:347
struct MemoryContextData * assoc_context
Definition: elog.h:360
void * palloc(Size size)
Definition: mcxt.c:835
char * constraint_name
Definition: elog.h:353
char * message
Definition: elog.h:343

◆ DebugFileOpen()

void DebugFileOpen ( void  )

Definition at line 1863 of file elog.c.

References buf, close, CurrentMemoryContext, DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5, DEFAULT_EVENT_SOURCE, encoding, ereport, errcode_for_file_access(), errmsg(), ERROR, event_source, FATAL, fd(), free, GetMessageEncoding(), i, in_error_recursion_trouble(), INFO, IsUnderPostmaster, LOG, LOG_SERVER_ONLY, Min, NOTICE, OutputFileName, PANIC, pfree(), pg_mbcliplen(), syslog_facility, syslog_sequence_numbers, syslog_split_messages, and WARNING.

Referenced by BaseInit().

1864 {
1865  int fd,
1866  istty;
1867 
1868  if (OutputFileName[0])
1869  {
1870  /*
1871  * A debug-output file name was given.
1872  *
1873  * Make sure we can write the file, and find out if it's a tty.
1874  */
1875  if ((fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY,
1876  0666)) < 0)
1877  ereport(FATAL,
1879  errmsg("could not open file \"%s\": %m", OutputFileName)));
1880  istty = isatty(fd);
1881  close(fd);
1882 
1883  /*
1884  * Redirect our stderr to the debug output file.
1885  */
1886  if (!freopen(OutputFileName, "a", stderr))
1887  ereport(FATAL,
1889  errmsg("could not reopen file \"%s\" as stderr: %m",
1890  OutputFileName)));
1891 
1892  /*
1893  * If the file is a tty and we're running under the postmaster, try to
1894  * send stdout there as well (if it isn't a tty then stderr will block
1895  * out stdout, so we may as well let stdout go wherever it was going
1896  * before).
1897  */
1898  if (istty && IsUnderPostmaster)
1899  if (!freopen(OutputFileName, "a", stdout))
1900  ereport(FATAL,
1902  errmsg("could not reopen file \"%s\" as stdout: %m",
1903  OutputFileName)));
1904  }
1905 }
static int fd(const char *x, int i)
Definition: preproc-init.c:105
#define FATAL
Definition: elog.h:52
char OutputFileName[MAXPGPATH]
Definition: globals.c:62
bool IsUnderPostmaster
Definition: globals.c:101
int errcode_for_file_access(void)
Definition: elog.c:598
#define ereport(elevel, rest)
Definition: elog.h:122
int errmsg(const char *fmt,...)
Definition: elog.c:797
#define close(a)
Definition: win32.h:12

◆ elog_finish()

void elog_finish ( int  elevel,
const char *  fmt,
  ... 
)

Definition at line 1348 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errfinish(), errordata_stack_depth, errstart(), EVALUATE_MESSAGE, ErrorData::filename, ErrorData::funcname, ErrorData::lineno, MemoryContextSwitchTo(), ErrorData::message_id, recursion_depth, and ErrorData::saved_errno.

1349 {
1351  MemoryContext oldcontext;
1352 
1354 
1355  /*
1356  * Do errstart() to see if we actually want to report the message.
1357  */
1359  errno = edata->saved_errno;
1360  if (!errstart(elevel, edata->filename, edata->lineno, edata->funcname, NULL))
1361  return; /* nothing to do */
1362 
1363  /*
1364  * Format error message just like errmsg_internal().
1365  */
1366  recursion_depth++;
1367  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1368 
1369  edata->message_id = fmt;
1370  EVALUATE_MESSAGE(edata->domain, message, false, false);
1371 
1372  MemoryContextSwitchTo(oldcontext);
1373  recursion_depth--;
1374 
1375  /*
1376  * And let errfinish() finish up.
1377  */
1378  errfinish(0);
1379 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
const char * funcname
Definition: elog.h:339
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
int lineno
Definition: elog.h:338
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
bool errstart(int elevel, const char *filename, int lineno, const char *funcname, const char *domain)
Definition: elog.c:233
void errfinish(int dummy,...)
Definition: elog.c:413
static int errordata_stack_depth
Definition: elog.c:142
const char * filename
Definition: elog.h:337
int saved_errno
Definition: elog.h:357
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
static int elevel
Definition: vacuumlazy.c:136
const char * message_id
Definition: elog.h:348
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ elog_start()

void elog_start ( const char *  filename,
int  lineno,
const char *  funcname 
)

Definition at line 1298 of file elog.c.

References ErrorData::assoc_context, ereport, errmsg_internal(), ErrorContext, errordata_stack_depth, ERRORDATA_STACK_SIZE, filename, ErrorData::filename, ErrorData::funcname, ErrorData::lineno, PANIC, ErrorData::saved_errno, and write_stderr().

1299 {
1300  ErrorData *edata;
1301 
1302  /* Make sure that memory context initialization has finished */
1303  if (ErrorContext == NULL)
1304  {
1305  /* Oops, hard crash time; very little we can do safely here */
1306  write_stderr("error occurred at %s:%d before error message processing is available\n",
1307  filename ? filename : "(unknown file)", lineno);
1308  exit(2);
1309  }
1310 
1312  {
1313  /*
1314  * Wups, stack not big enough. We treat this as a PANIC condition
1315  * because it suggests an infinite loop of errors during error
1316  * recovery. Note that the message is intentionally not localized,
1317  * else failure to convert it to client encoding could cause further
1318  * recursion.
1319  */
1320  errordata_stack_depth = -1; /* make room on stack */
1321  ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
1322  }
1323 
1324  edata = &errordata[errordata_stack_depth];
1325  if (filename)
1326  {
1327  const char *slash;
1328 
1329  /* keep only base name, useful especially for vpath builds */
1330  slash = strrchr(filename, '/');
1331  if (slash)
1332  filename = slash + 1;
1333  }
1334  edata->filename = filename;
1335  edata->lineno = lineno;
1336  edata->funcname = funcname;
1337  /* errno is saved now so that error parameter eval can't change it */
1338  edata->saved_errno = errno;
1339 
1340  /* Use ErrorContext for any allocations done at this level. */
1341  edata->assoc_context = ErrorContext;
1342 }
MemoryContext ErrorContext
Definition: mcxt.c:44
const char * funcname
Definition: elog.h:339
#define ERRORDATA_STACK_SIZE
Definition: elog.c:138
int lineno
Definition: elog.h:338
#define PANIC
Definition: elog.h:53
static int errordata_stack_depth
Definition: elog.c:142
const char * filename
Definition: elog.h:337
int saved_errno
Definition: elog.h:357
#define ereport(elevel, rest)
Definition: elog.h:122
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
int errmsg_internal(const char *fmt,...)
Definition: elog.c:827
void write_stderr(const char *fmt,...)
Definition: elog.c:3676
struct MemoryContextData * assoc_context
Definition: elog.h:360
static char * filename
Definition: pg_dumpall.c:90

◆ EmitErrorReport()

void EmitErrorReport ( void  )

Definition at line 1446 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, emit_log_hook, errordata_stack_depth, MemoryContextSwitchTo(), ErrorData::output_to_client, ErrorData::output_to_server, recursion_depth, send_message_to_frontend(), and send_message_to_server_log().

Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWriterMain(), CheckpointerMain(), do_autovacuum(), errfinish(), perform_work_item(), PostgresMain(), StartBackgroundWorker(), and WalWriterMain().

1447 {
1449  MemoryContext oldcontext;
1450 
1451  recursion_depth++;
1453  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1454 
1455  /*
1456  * Call hook before sending message to log. The hook function is allowed
1457  * to turn off edata->output_to_server, so we must recheck that afterward.
1458  * Making any other change in the content of edata is not considered
1459  * supported.
1460  *
1461  * Note: the reason why the hook can only turn off output_to_server, and
1462  * not turn it on, is that it'd be unreliable: we will never get here at
1463  * all if errstart() deems the message uninteresting. A hook that could
1464  * make decisions in that direction would have to hook into errstart(),
1465  * where it would have much less information available. emit_log_hook is
1466  * intended for custom log filtering and custom log message transmission
1467  * mechanisms.
1468  *
1469  * The log hook has access to both the translated and original English
1470  * error message text, which is passed through to allow it to be used as a
1471  * message identifier. Note that the original text is not available for
1472  * detail, detail_log, hint and context text elements.
1473  */
1474  if (edata->output_to_server && emit_log_hook)
1475  (*emit_log_hook) (edata);
1476 
1477  /* Send to server log, if enabled */
1478  if (edata->output_to_server)
1480 
1481  /* Send to client, if enabled */
1482  if (edata->output_to_client)
1483  send_message_to_frontend(edata);
1484 
1485  MemoryContextSwitchTo(oldcontext);
1486  recursion_depth--;
1487 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
static void send_message_to_server_log(ErrorData *edata)
Definition: elog.c:2869
static int errordata_stack_depth
Definition: elog.c:142
bool output_to_server
Definition: elog.h:332
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
static void send_message_to_frontend(ErrorData *edata)
Definition: elog.c:3152
struct MemoryContextData * assoc_context
Definition: elog.h:360
emit_log_hook_type emit_log_hook
Definition: elog.c:101
bool output_to_client
Definition: elog.h:333

◆ err_generic_string()

int err_generic_string ( int  field,
const char *  str 
)

Definition at line 1191 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::datatype_name, elog, ERROR, errordata_stack_depth, PG_DIAG_COLUMN_NAME, PG_DIAG_CONSTRAINT_NAME, PG_DIAG_DATATYPE_NAME, PG_DIAG_SCHEMA_NAME, PG_DIAG_TABLE_NAME, ErrorData::schema_name, set_errdata_field(), and ErrorData::table_name.

Referenced by errdatatype(), errdomainconstraint(), errtable(), errtablecolname(), errtableconstraint(), exec_stmt_raise(), PLy_elog_impl(), and PLy_output().

1192 {
1194 
1195  /* we don't bother incrementing recursion_depth */
1197 
1198  switch (field)
1199  {
1200  case PG_DIAG_SCHEMA_NAME:
1201  set_errdata_field(edata->assoc_context, &edata->schema_name, str);
1202  break;
1203  case PG_DIAG_TABLE_NAME:
1204  set_errdata_field(edata->assoc_context, &edata->table_name, str);
1205  break;
1206  case PG_DIAG_COLUMN_NAME:
1207  set_errdata_field(edata->assoc_context, &edata->column_name, str);
1208  break;
1209  case PG_DIAG_DATATYPE_NAME:
1211  break;
1214  break;
1215  default:
1216  elog(ERROR, "unsupported ErrorData field id: %d", field);
1217  break;
1218  }
1219 
1220  return 0; /* return value does not matter */
1221 }
char * schema_name
Definition: elog.h:349
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
#define PG_DIAG_SCHEMA_NAME
Definition: postgres_ext.h:65
#define PG_DIAG_COLUMN_NAME
Definition: postgres_ext.h:67
#define PG_DIAG_TABLE_NAME
Definition: postgres_ext.h:66
static int errordata_stack_depth
Definition: elog.c:142
#define ERROR
Definition: elog.h:43
char * table_name
Definition: elog.h:350
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
char * datatype_name
Definition: elog.h:352
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str)
Definition: elog.c:1227
#define PG_DIAG_DATATYPE_NAME
Definition: postgres_ext.h:68
#define PG_DIAG_CONSTRAINT_NAME
Definition: postgres_ext.h:69
char * column_name
Definition: elog.h:351
struct MemoryContextData * assoc_context
Definition: elog.h:360
#define elog
Definition: elog.h:219
char * constraint_name
Definition: elog.h:353

◆ err_gettext()

static const char * err_gettext ( const char *  str)
inlinestatic

Definition at line 208 of file elog.c.

References gettext, in_error_recursion_trouble(), and generate_unaccent_rules::str.

209 {
210 #ifdef ENABLE_NLS
212  return str;
213  else
214  return gettext(str);
215 #else
216  return str;
217 #endif
218 }
#define gettext(x)
Definition: c.h:975
bool in_error_recursion_trouble(void)
Definition: elog.c:196

◆ err_sendstring()

static void err_sendstring ( StringInfo  buf,
const char *  str 
)
static

Definition at line 3140 of file elog.c.

References in_error_recursion_trouble(), pq_send_ascii_string(), and pq_sendstring().

Referenced by send_message_to_frontend().

3141 {
3143  pq_send_ascii_string(buf, str);
3144  else
3145  pq_sendstring(buf, str);
3146 }
void pq_sendstring(StringInfo buf, const char *str)
Definition: pqformat.c:197
void pq_send_ascii_string(StringInfo buf, const char *str)
Definition: pqformat.c:229
bool in_error_recursion_trouble(void)
Definition: elog.c:196

◆ errcode()

int errcode ( int  sqlerrcode)

Definition at line 575 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by _arrq_cons(), _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_pagedel(), _crypt_blowfish_rn(), _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_execute_plan(), AbortBufferIO(), abstime2tm(), abstime_date(), abstime_timestamp(), abstime_timestamptz(), accumArrayResultArr(), aclcheck_error(), aclcheck_error_col(), aclinsert(), aclitemin(), aclparse(), aclremove(), add_json(), add_jsonb(), add_parameter_name(), add_reloption_kind(), add_rte_to_flat_rtable(), add_size(), addCompoundAffixFlagValue(), AddEnumLabel(), addFamilyMember(), AddQual(), addRangeTableEntryForCTE(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForSubquery(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRoleMems(), addTargetToSortList(), AdjustIntervalForTypmod(), AdjustTimestampForTypmod(), advance_windowaggregate(), AfterTriggerSetState(), AggregateCreate(), alen_object_start(), alen_scalar(), AllocateDir(), AllocateFile(), AllocateVfd(), AllocSetContextCreateExtended(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainAddConstraint(), AlterDomainDropConstraint(), AlterDomainNotNull(), 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(), AlterPublicationOwner(), AlterPublicationOwner_internal(), AlterPublicationOwner_oid(), AlterPublicationTables(), AlterRelationNamespaceInternal(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSubscription(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), AlterSubscriptionOwner_oid(), AlterSystemSetConfigFile(), AlterTableMoveAll(), AlterTableNamespace(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTypeNamespace(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterUserMapping(), analyze_rel(), analyzeCTE(), analyzeCTETargetList(), anyarray_in(), anyarray_recv(), anybit_typmodin(), anychar_typmodin(), anyenum_in(), anyrange_in(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_origin(), apply_typmod(), apw_start_database_worker(), apw_start_master_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), 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_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assignOperTypes(), assignProcTypes(), AssignTypeArrayOid(), Async_Notify(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepDropColumn(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetStatistics(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), ATWrongRelkindError(), auth_failed(), autoinc(), autoprewarm_database_main(), autoprewarm_start_worker(), AuxiliaryProcessMain(), b64_decode(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFilePerm(), be_lo_close(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), 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(), BeginCopy(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), BootStrapXLOG(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brinGetTupleForHeapBlock(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_check(), bt_index_check_internal(), bt_metap(), bt_page_items(), bt_page_items_bytea(), bt_page_stats(), bt_right_page_check_scankey(), bt_target_page_check(), btree_index_checkable(), btvalidate(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), build_row_from_class(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), changeDependencyFor(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_agglevels_and_constraints(), check_circularity(), check_conn_params(), check_default_allows_bound(), check_default_tablespace(), 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_is_member_of_role(), check_lateral_ref_ok(), check_new_partition_bound(), check_object_ownership(), check_of_type(), check_parameter_resolution_walker(), check_password(), check_permissions(), check_primary_key(), check_publication_add_relation(), check_relation_privileges(), check_relation_relkind(), check_relation_updatable(), check_restricted_library_name(), check_rolespec_name(), check_sql_fn_retval(), check_srf_call_placement(), check_stack_depth(), check_strxfrm_bug(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPredicate(), CheckRecoveryConflictDeadlock(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), CheckTransactionChain(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), ClientAuthentication(), close_lb(), close_sl(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), colNameToVar(), CommandCounterIncrement(), CommentObject(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_attributes_sql_style(), compute_attributes_with_style(), compute_common_attribute(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConnCreate(), connect_pg_server(), connectby_text(), connectby_text_serial(), construct_md_array(), ConversionCreate(), convert_and_check_filename(), convert_any_priv_string(), convert_column_name(), convert_function_name(), convert_priv_string(), convert_tuples_by_name_map(), convert_tuples_by_position(), convert_type_name(), convertJsonbArray(), convertJsonbObject(), cookConstraint(), cookDefault(), copy_relation_data(), CopyFrom(), CopyGetAttnums(), CopyGetData(), CopyReadAttributesCSV(), CopyReadAttributesText(), CopyReadBinaryAttribute(), CopyReadLineText(), CopySendEndOfRow(), create_ctas_nodata(), create_distinct_paths(), create_grouping_paths(), create_proc_lang(), create_tablespace_directories(), create_toast_table(), CreateAccessMethod(), CreateCast(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_coord(), cube_coord_llur(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dasin(), dasind(), date2timestamp(), date2timestamptz(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_encoding_convert(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), 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(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), 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(), deflist_to_tuplestore(), deleteConnection(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_to_timestamp(), DoCopy(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_create(), dsm_impl_sysv(), 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(), each_worker_jsonb(), ean2isn(), ean2string(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EndPrepare(), EndTransactionBlock(), enforce_generic_type_consistency(), enlargeStringInfo(), enum_cmp_internal(), enum_first(), enum_in(), enum_last(), enum_out(), enum_range_all(), enum_range_bounds(), enum_recv(), enum_send(), EnumValuesCreate(), errcode_for_dynamic_shared_memory(), error_commit_ts_disabled(), error_duplicate_filter_variable(), errorMissingColumn(), errorMissingRTE(), esc_dec_len(), esc_decode(), EvalPlanQualFetch(), EvalPlanQualFetchRowMarks(), EvaluateParams(), exec_assign_value(), exec_bind_message(), 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_object_restorecon(), exec_parse_message(), exec_prepare_plan(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_block(), 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(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecCallTriggerFunc(), ExecCheckHeapTupleVisible(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecConstraints(), ExecCreateTableAs(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalArrayRefSubscript(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecInitAgg(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInsert(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheck(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteCallStmt(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteTruncate(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), ExitPostmaster(), exp_var(), expand_col_privileges(), ExpandAllTables(), ExpandColumnRefStar(), ExplainQuery(), ExportSnapshot(), exprType(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), FetchDynamicTimeZone(), FetchPreparedStatement(), file_fdw_validator(), FileWrite(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_dynamic_libpath(), find_provider(), find_typed_table_dependencies(), findDependentObjects(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), float48div(), float4_numeric(), float4div(), float4in(), float84div(), float8_numeric(), float8_timestamptz(), float8div(), float8in_internal(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), forkname_to_number(), free_parsestate(), 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(), gbtreekey_in(), gbtreekey_out(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), get_am_type_oid(), get_cast_oid(), get_collation_oid(), get_connect_string(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_encoding_name_for_icu(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), 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_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page_internal(), 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_rte_attribute_type(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), 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(), getAffixFlagSet(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), getdatafield(), GetDefaultOpClass(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetOldFunctionMessage(), GetPublicationByName(), GetRunningTransactionData(), GetSafeSnapshot(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), GetSQLCurrentDate(), GetSQLCurrentTime(), GetSQLLocalTime(), gettoken_query(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginCombineData(), GinFormTuple(), ginNewScanKey(), ginvalidate(), gistcheckpage(), gistSplit(), gistUserPicksplit(), gistvalidate(), gistValidateBufferingOption(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleFunctionRequest(), HandleParallelMessages(), 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_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_scalar(), hash_search_with_hash_value(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_form_minimal_tuple(), heap_form_tuple(), heap_inplace_update(), heap_lock_tuple(), heap_open(), heap_openrv(), heap_openrv_extended(), heap_page_items(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_update(), hex2_to_uchar(), hex_decode(), hlparsetext(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), ident_inet(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), index_check_primary_key(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_open(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), init_sql_fcache(), initArrayResultArr(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), InitWalSenderSlot(), inner_subltree(), insert_username(), InsertRule(), 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(), int4inc(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8inc(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_get_result_type(), internal_inetpl(), internal_load_library(), interpret_AS_clause(), interpret_func_parallel(), interpret_function_parameter_list(), interpretOidsOption(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_set(), JsValueToJsObject(), LargeObjectDrop(), lastval(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_exec(), like_fixed_prefix(), line_in(), ln_var(), lo_get_fragment_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_libraries(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), logicalrep_rel_open(), logicalrep_typmap_getid(), logicalrep_worker_attach(), logicalrep_worker_launch(), lookup_agg_function(), lookup_fdw_handler_func(), lookup_index_am_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), ltree_to_plpython(), ltxtq_out(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), make_absolute_path(), make_bound_box(), make_date(), make_distinct_op(), make_interval(), make_op(), make_outerjoininfo(), make_pathkeys_for_window(), make_result(), 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(), makeArrayTypeName(), makepol(), makeRangeVarFromNameList(), map_sql_value_to_xml_value(), MarkAsPreparing(), MarkPortalActive(), MatchText(), materializeResult(), md5_bytea(), md5_text(), mdextend(), mdread(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), movedb(), mul_size(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), NonFiniteTimestampTzPart(), NUM_processor(), NUMDesc_prepare(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4(), numeric_int8(), numeric_power(), numeric_recv(), numeric_to_double_no_overflow(), numerictypmodin(), numericvar_to_double_no_overflow(), numericvar_to_int32(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), on_proc_exit(), on_shmem_exit(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum(), page_header(), PageAddItemExtended(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_extension_control_file(), parse_fcall_arguments(), parse_fcall_arguments_20(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_key_value_arrays(), parse_one_reloption(), parse_output_parameters(), parse_phrase_operator(), parse_publication_options(), parse_re_flags(), parse_sane_timezone(), parse_snapshot(), parse_subscription_options(), parse_tsquery(), parseCheckAggregates(), parseCreateReplSlotOptions(), ParseFuncOrColumn(), parseIntFromText(), parseNameAndArgTypes(), parseRelOptions(), parserOpenTable(), parsetext(), parsetinterval(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFilePerm(), percentile_cont_final_common(), percentile_disc_final(), perform_default_encoding_conversion(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_be_scram_build_verifier(), pg_be_scram_exchange(), pg_cancel_backend(), pg_char_to_encoding(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_ddl_command_in(), pg_ddl_command_out(), pg_ddl_command_recv(), pg_ddl_command_send(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_ownercheck(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_extension_update_paths(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_serial_sequence(), pg_hba_file_rules(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), pg_logdir_ls(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_lsn_in(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_ndistinct_in(), pg_ndistinct_recv(), pg_newlocale_from_collation(), pg_node_tree_in(), pg_node_tree_recv(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_prepared_statement(), pg_prewarm(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_publication_ownercheck(), pg_random_bytes(), pg_read_binary_file(), pg_read_file(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_saslprep(), pg_sequence_last_value(), pg_sequence_parameters(), pg_set_regex_collation(), pg_show_replication_origin_status(), pg_size_bytes(), pg_start_backup(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_progress_info(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pg_stat_statements_reset(), pg_statistics_object_ownercheck(), pg_stop_backup(), pg_stop_backup_v2(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_visibility(), pg_visibility_map(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), pgrowlocks(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_init(), pgstat_relation(), pgstat_reset_shared_counters(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), placeChar(), 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_trigger_handler(), plperl_trusted_init(), plperl_untrusted_init(), plperl_validator(), plpgsql_build_variable(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_exec_trigger(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_resolve_polymorphic_argtypes(), 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_function_build_args(), PLy_modify_tuple(), PLy_output(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyObject_AsString(), PLySequence_ToComposite(), PLyString_ToComposite(), point_div(), policy_role_list_to_array(), poly_circle(), poly_distance(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_record_worker(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_validator(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), 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_sql_fn_parse_info(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventAdvisoryLocksInParallelMode(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventTransactionChain(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_matched_tle(), process_owned_by(), process_postgres_switches(), ProcessCopyOptions(), ProcessGUCArray(), ProcessInterrupts(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), processTypesSpec(), ProcessWalRcvInterrupts(), protect_out_of_mem(), prsd_headline(), prssyntaxerror(), publication_add_relation(), PublicationDropTables(), publicationListToArray(), pushquery(), PushTransaction(), pushval_asis(), pushValue(), pushValue_internal(), pvsnprintf(), px_crypt_des(), px_THROW_ERROR(), qtext_load_file(), QTN2QT(), QualifiedNameGetCreationNamespace(), query_to_xml_internal(), queryin(), quickdie(), range_constructor3(), range_minus(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), 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_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadBuffer_common(), ReadBufferExtended(), ReadControlFile(), readRecoveryCommandFile(), readstoplist(), ReassignOwnedObjects(), ReceiveCopyBegin(), recompute_limits(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), recordDependencyOnCurrentExtension(), recursive_revoke(), recv_password_packet(), refresh_by_match_merge(), regex_fixed_prefix(), regexp_fixed_prefix(), regexp_match(), regexp_split_to_array(), regexp_split_to_table(), RegisterBackgroundWorker(), RegisterExtensibleNodeEntry(), RegisterTimeout(), regnamespacein(), regoperatorin(), regoperin(), regprocedurein(), regprocin(), regrolein(), reindex_index(), ReindexMultipleTables(), RelationBuildPartitionKey(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), reltime_interval(), remove_tablespace_symlink(), RemoveAccessMethodById(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePolicyById(), RemoveRelations(), RemoveRoleFromObjectPolicy(), RemoveTriggerById(), RemoveUserMapping(), rename_constraint_internal(), rename_policy(), renameatt_check(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquire(), ReplicationSlotCreate(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_invalid_token(), report_name_conflict(), report_namespace_conflict(), report_parse_error(), report_untranslatable_char(), reportDependentObjects(), requireSuperuser(), reserveAllocatedDesc(), resolve_column_ref(), resolve_generic_type(), resolve_unique_index_expr(), ResolveOpClass(), RestoreGUCState(), restrict_and_check_grant(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), RI_FKey_fk_upd_check_required(), RI_FKey_pk_upd_check_required(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), ri_restrict(), ri_setdefault(), ri_setnull(), RollbackToSavepoint(), rpad(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_perl_context(), SendCopyBegin(), sendDir(), SendFunctionResult(), sepgsql_attribute_relabel(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_check_perms(), 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(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), SetSerializableTransactionSnapshot(), SetSessionAuthorization(), setTargetTable(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), similar_escape(), SlabContextCreate(), SnapBuildInitialSnapshot(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgvalidate(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), split_text(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutovacuumWorker(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupXLOG(), statext_dependencies_deserialize(), statext_ndistinct_deserialize(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_tolower(), str_toupper(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), substitute_libpath_macro(), suppress_redundant_updates_trigger(), SyncRepWaitForLSN(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), tablesample_init(), TablespaceCreateDbspace(), tblspc_redo(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), TestForOldSnapshot_impl(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_substring(), text_to_bits(), textarray_to_strvaluelist(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_part(), time_recv(), timestamp2timestamptz(), timestamp_abstime(), timestamp_age(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_abstime(), timestamptz_age(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc(), timestamptz_zone(), timetz_izone(), timetz_part(), timetz_recv(), timetz_zone(), tintervalrecv(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), tokenize_file(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformArrayExpr(), transformArraySubscripts(), transformArrayType(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), truncate_check_rel(), truncate_identifier(), 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_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tuple_equals_slot(), tupledesc_match(), txid_snapshot_recv(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_init(), unique_key_recheck(), unknown_attribute(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vacuum(), vacuum_rel(), validate_ddl_tags(), validate_option_array_item(), validate_pkattnums(), validate_table_rewrite_tags(), validateCheckConstraint(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePgVersion(), ValidateRestrictionEstimator(), validateWithCheckOption(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_cmp(), varstr_levenshtein(), varstr_sortsupport(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitForParallelWorkersToExit(), WalRcvFetchTimeLineHistoryFiles(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), X509_NAME_field_to_text(), X509_NAME_to_text(), XlogReadTwoPhaseData(), XLogWalRcvProcessMsg(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

576 {
578 
579  /* we don't bother incrementing recursion_depth */
581 
582  edata->sqlerrcode = sqlerrcode;
583 
584  return 0; /* return value does not matter */
585 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int sqlerrcode
Definition: elog.h:342
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errcode_for_file_access()

int errcode_for_file_access ( void  )

Definition at line 598 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::saved_errno, and ErrorData::sqlerrcode.

Referenced by _mdfd_getseg(), _mdnblocks(), _ShowOption(), AddToDataDirLockFile(), AlterSystemSetConfigFile(), ApplyLogicalMappingFile(), apw_dump_now(), apw_load_buffers(), assign_xlog_sync_method(), BackendRun(), be_lo_export(), be_tls_init(), BeginCopyFrom(), BeginCopyTo(), BootStrapXLOG(), BufFileOpenShared(), calculate_relation_size(), calculate_tablespace_size(), CancelBackup(), ChangeToDataDir(), checkDataDir(), CheckForStandbyTrigger(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckXLogRemoved(), ClosePipeToProgram(), ClosePostmasterPorts(), copy_file(), copydir(), CopyGetData(), CopySendEndOfRow(), create_tablespace_directories(), CreateLockFile(), CreateSlotOnDisk(), db_dir_size(), DebugFileOpen(), DeleteAllExportedSnapshotFiles(), destroy_tablespace_directories(), do_pg_start_backup(), do_pg_stop_backup(), dsm_cleanup_for_mmap(), durable_link_or_rename(), durable_rename(), durable_unlink(), EndCopy(), entry_reset(), errcode_for_dynamic_shared_memory(), ExecHashJoinGetSavedTuple(), ExecHashJoinNewBatch(), ExecHashJoinSaveTuple(), existsTimeLineHistory(), exitArchiveRecovery(), ExportSnapshot(), file_exists(), fileAnalyzeForeignTable(), fill_hba_view(), fsync_fname_ext(), gc_qtexts(), get_controlfile(), getInstallationPaths(), getlen(), heap_xlog_logical_rewrite(), InitPostgres(), InitPostmasterDeathWatchHandle(), internal_load_library(), internal_unload_library(), issue_xlog_fsync(), KeepFileRestoredFromArchive(), lo_import_internal(), load_dh_file(), load_hba(), load_ident(), load_relmap_file(), logfile_open(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), ltsReadBlock(), ltsWriteBlock(), mdcreate(), mdextend(), mdimmedsync(), mdopen(), mdpostckpt(), mdread(), mdsync(), mdtruncate(), mdunlinkfork(), mdwrite(), parse_extension_control_file(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenTemporaryFile(), perform_base_backup(), pg_backup_start_time(), pg_current_logfile(), pg_file_rename(), pg_file_unlink(), pg_file_write(), pg_flush_data(), pg_import_system_collations(), pg_logdir_ls(), pg_ls_dir(), pg_ls_dir_files(), pg_stat_file(), pg_tablespace_databases(), pg_tablespace_location(), pg_tzenumerate_next(), pg_tzenumerate_start(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PostmasterMain(), qtext_load_file(), qtext_store(), read_backup_label(), read_binary_file(), read_tablespace_map(), read_whole_file(), ReadControlFile(), ReadDirExtended(), readRecoveryCommandFile(), readTimeLineHistory(), readtup_heap(), ReadTwoPhaseFile(), RecheckDataDirLockFile(), RecreateTwoPhaseFile(), register_dirty_segment(), RelationCacheInitFilePreInvalidate(), remove_tablespace_symlink(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemoveTwoPhaseFile(), RemoveXlogFile(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), ReplicationSlotDropPtr(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), RestoreArchivedFile(), RestoreSlotFromDisk(), SaveSlotToPath(), sendDir(), sendFile(), sendTablespace(), SendTimeLineHistory(), SlruReportIOError(), SnapBuildRestore(), SnapBuildSerialize(), StartupReorderBuffer(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupXLOG(), StreamServerPort(), SyncDataDirectory(), SysLogger_Start(), TablespaceCreateDbspace(), tokenize_file(), tokenize_inc_file(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), unlink_if_exists_fname(), update_metainfo_datafile(), UpdateControlFile(), ValidatePgVersion(), walkdir(), WalReceiverMain(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_file(), write_syslogger_file(), WriteControlFile(), WriteTempFileBlock(), writeTimeLineHistory(), writeTimeLineHistoryFile(), writetup_heap(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogPageRead(), XLogRead(), XlogReadTwoPhaseData(), XLogWalRcvWrite(), and XLogWrite().

599 {
601 
602  /* we don't bother incrementing recursion_depth */
604 
605  switch (edata->saved_errno)
606  {
607  /* Permission-denied failures */
608  case EPERM: /* Not super-user */
609  case EACCES: /* Permission denied */
610 #ifdef EROFS
611  case EROFS: /* Read only file system */
612 #endif
613  edata->sqlerrcode = ERRCODE_INSUFFICIENT_PRIVILEGE;
614  break;
615 
616  /* File not found */
617  case ENOENT: /* No such file or directory */
618  edata->sqlerrcode = ERRCODE_UNDEFINED_FILE;
619  break;
620 
621  /* Duplicate file */
622  case EEXIST: /* File exists */
623  edata->sqlerrcode = ERRCODE_DUPLICATE_FILE;
624  break;
625 
626  /* Wrong object type or state */
627  case ENOTDIR: /* Not a directory */
628  case EISDIR: /* Is a directory */
629 #if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
630  case ENOTEMPTY: /* Directory not empty */
631 #endif
632  edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
633  break;
634 
635  /* Insufficient resources */
636  case ENOSPC: /* No space left on device */
637  edata->sqlerrcode = ERRCODE_DISK_FULL;
638  break;
639 
640  case ENFILE: /* File table overflow */
641  case EMFILE: /* Too many open files */
642  edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;
643  break;
644 
645  /* Hardware failure */
646  case EIO: /* I/O error */
647  edata->sqlerrcode = ERRCODE_IO_ERROR;
648  break;
649 
650  /* All else is classified as internal errors */
651  default:
652  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
653  break;
654  }
655 
656  return 0; /* return value does not matter */
657 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int sqlerrcode
Definition: elog.h:342
static int errordata_stack_depth
Definition: elog.c:142
int saved_errno
Definition: elog.h:357
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errcode_for_socket_access()

int errcode_for_socket_access ( void  )

Definition at line 669 of file elog.c.

References CHECK_STACK_DEPTH, ECONNRESET, errordata_stack_depth, ErrorData::saved_errno, and ErrorData::sqlerrcode.

Referenced by be_tls_open_server(), ident_inet(), InitPostmasterDeathWatchHandle(), internal_flush(), ModifyWaitEvent(), pgstat_init(), PgstatCollectorMain(), pq_getbyte_if_available(), pq_recvbuf(), ProcessStartupPacket(), ServerLoop(), StreamConnection(), StreamServerPort(), SysLogger_Start(), SysLoggerMain(), and WaitEventSetWait().

670 {
672 
673  /* we don't bother incrementing recursion_depth */
675 
676  switch (edata->saved_errno)
677  {
678  /* Loss of connection */
679  case EPIPE:
680 #ifdef ECONNRESET
681  case ECONNRESET:
682 #endif
683  edata->sqlerrcode = ERRCODE_CONNECTION_FAILURE;
684  break;
685 
686  /* All else is classified as internal errors */
687  default:
688  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
689  break;
690  }
691 
692  return 0; /* return value does not matter */
693 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int sqlerrcode
Definition: elog.h:342
static int errordata_stack_depth
Definition: elog.c:142
int saved_errno
Definition: elog.h:357
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
#define ECONNRESET
Definition: win32_port.h:344

◆ errcontext_msg()

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

Definition at line 1012 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::context_domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

1013 {
1015  MemoryContext oldcontext;
1016 
1017  recursion_depth++;
1019  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1020 
1021  EVALUATE_MESSAGE(edata->context_domain, context, true, true);
1022 
1023  MemoryContextSwitchTo(oldcontext);
1024  recursion_depth--;
1025  return 0; /* return value does not matter */
1026 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
const char * context_domain
Definition: elog.h:341
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360

◆ errdetail()

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

Definition at line 873 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by _bt_check_unique(), AbortBufferIO(), AddEnumLabel(), AggregateCreate(), AllocSetContextCreateExtended(), AlterExtensionNamespace(), AlterPublicationTables(), AlterTableNamespace(), apply_typmod(), array_cat(), array_fill_internal(), array_in(), array_set_slice(), ArrayCount(), asyncQueueFillWarning(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddInherit(), ATExecAlterColumnType(), ATExecAttachPartition(), ATExecChangeOwner(), ATPrepAlterColumnType(), ATPrepChangePersistence(), be_tls_init(), brin_page_type(), btree_index_checkable(), CancelBackup(), check_conn_params(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_lateral_ref_ok(), check_new_partition_bound(), check_primary_key(), check_publication_add_relation(), check_rolespec_name(), check_sql_fn_retval(), check_ungrouped_columns_walker(), check_valid_extension_name(), check_valid_version_name(), checkDataDir(), CheckMyDatabase(), CheckRecoveryConflictDeadlock(), checkRuleResultList(), checkStringLen(), CheckVarSlotCompatibility(), choose_hashed_setop(), coerce_record_to_complex(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compute_return_type(), ComputeIndexAttrs(), connect_pg_server(), convert_tuples_by_name_map(), convert_tuples_by_position(), copy_heap_data(), create_distinct_paths(), create_grouping_paths(), createdb(), CreateDecodingContext(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateTableSpace(), CreateTrigger(), crosstab(), dblink_connstr_check(), dblink_fdw_validator(), dblink_security_check(), DefineOpClass(), DropSubscription(), dsa_allocate_extended(), dshash_create(), enforce_generic_type_consistency(), enlargeStringInfo(), EnumValuesCreate(), errdetail_abort(), errdetail_busy_db(), errdetail_execute(), errdetail_params(), errdetail_recovery_conflict(), EvaluateParams(), exec_assign_value(), exec_eval_datum(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_return_next(), ExecCheckPlanOutput(), ExecConstraints(), ExecEvalArrayExpr(), ExecEvalFieldSelect(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecPartitionCheck(), ExecWithCheckOptions(), ExitPostmaster(), FetchDynamicTimeZone(), FloatExceptionHandler(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), generate_recursion_path(), generateClonedIndexStmt(), GenerationContextCreate(), get_connect_string(), get_crosstab_tuplestore(), get_page_from_raw(), getid(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), gin_leafpage_items(), gin_metapage_info(), gistbulkdelete(), gistdoinsert(), gistValidateBufferingOption(), heap_create(), heap_truncate_check_FKs(), hlparsetext(), ident_inet(), incompatible_module_error(), InitPgFdwOptions(), InitPostgres(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), json_lex_string(), lazy_cleanup_index(), lc_ctype_is_c(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), LogChildExit(), LogicalRepSyncTableStart(), lquery_in(), ltree_in(), ltxtq_out(), make_pathkeys_for_window(), make_row_comparison_op(), map_sql_value_to_xml_value(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), MergeAttributes(), namerecv(), network_in(), network_recv(), NUMDesc_prepare(), palloc(), palloc0(), palloc_extended(), parse_ident(), parse_one_reloption(), parserOpenTable(), parsetext(), perform_default_encoding_conversion(), pg_be_scram_exchange(), pg_do_encoding_conversion(), pg_newlocale_from_collation(), pg_size_bytes(), pgarch_archiveXlog(), pgrowlocks(), PGSharedMemoryCreate(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_post_column_ref(), PLy_exec_function(), PLy_exec_trigger(), PLy_initialize(), PLySequence_ToArray_recurse(), PLyString_ToComposite(), populate_array_check_dimension(), preprocess_grouping_sets(), ProcedureCreate(), process_owned_by(), px_THROW_ERROR(), qtext_load_file(), queryin(), quickdie(), range_parse(), range_parse_bound(), read_any_attr(), read_attr_value(), read_client_final_message(), read_client_first_message(), ReadControlFile(), record_in(), refresh_by_match_merge(), RenameEnumLabel(), RenameRole(), RenameSchema(), RenameTableSpace(), repalloc(), repalloc_huge(), report_invalid_token(), report_parse_error(), reportDependentObjects(), rewriteTargetListIU(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), set_max_safe_fds(), SetTransactionSnapshot(), SlabContextCreate(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), StartReplication(), StartupXLOG(), SyncRepWaitForLSN(), tfuncInitialize(), transformAggregateCall(), transformDeclareCursorStmt(), transformIndexConstraint(), transformPartitionBoundValue(), transformSetOperationStmt(), transformTableLikeClause(), tupledesc_match(), vac_truncate_clog(), validateConnectbyTupleDesc(), ValidatePgVersion(), validateWithCheckOption(), variable_coerce_param_hook(), verify_brin_page(), verify_hash_page(), verify_message(), WalReceiverMain(), write_relcache_init_file(), XlogReadTwoPhaseData(), xml_is_document(), xmlpi(), and xpath_table().

874 {
876  MemoryContext oldcontext;
877 
878  recursion_depth++;
880  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
881 
882  EVALUATE_MESSAGE(edata->domain, detail, false, true);
883 
884  MemoryContextSwitchTo(oldcontext);
885  recursion_depth--;
886  return 0; /* return value does not matter */
887 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errdetail_internal()

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

Definition at line 900 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_check(), bt_right_page_check_scankey(), bt_target_page_check(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckSCRAMAuth(), ClosePipeToProgram(), connect_pg_server(), ConvertTriggerToFK(), dblink_connect(), dblink_get_conn(), dblink_res_error(), DeadLockReport(), DropRole(), elog_node_display(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), incompatible_module_error(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), OnConflict_CheckForSerializationFailure(), pgfdw_report_error(), PLy_elog_impl(), PLy_output(), PreCommit_CheckForSerializationFailure(), reindex_index(), rewriteTargetView(), ShowUsage(), SnapBuildFindSnapshot(), and xml_is_document().

901 {
903  MemoryContext oldcontext;
904 
905  recursion_depth++;
907  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
908 
909  EVALUATE_MESSAGE(edata->domain, detail, false, false);
910 
911  MemoryContextSwitchTo(oldcontext);
912  recursion_depth--;
913  return 0; /* return value does not matter */
914 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errdetail_log()

int errdetail_log ( const char *  fmt,
  ... 
)

Definition at line 921 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by auth_failed(), DeadLockReport(), DropRole(), ProcSleep(), and reportDependentObjects().

922 {
924  MemoryContext oldcontext;
925 
926  recursion_depth++;
928  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
929 
930  EVALUATE_MESSAGE(edata->domain, detail_log, false, true);
931 
932  MemoryContextSwitchTo(oldcontext);
933  recursion_depth--;
934  return 0; /* return value does not matter */
935 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errdetail_log_plural()

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

Definition at line 942 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), and recursion_depth.

Referenced by ProcSleep().

944 {
946  MemoryContext oldcontext;
947 
948  recursion_depth++;
950  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
951 
952  EVALUATE_MESSAGE_PLURAL(edata->domain, detail_log, false);
953 
954  MemoryContextSwitchTo(oldcontext);
955  recursion_depth--;
956  return 0; /* return value does not matter */
957 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
static int errordata_stack_depth
Definition: elog.c:142
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:748
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errdetail_plural()

int errdetail_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 965 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), and recursion_depth.

Referenced by dropdb(), errdetail_busy_db(), ExecEvalWholeRowVar(), GetNewMultiXactId(), ident_inet(), RegisterBackgroundWorker(), and tupledesc_match().

967 {
969  MemoryContext oldcontext;
970 
971  recursion_depth++;
973  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
974 
975  EVALUATE_MESSAGE_PLURAL(edata->domain, detail, false);
976 
977  MemoryContextSwitchTo(oldcontext);
978  recursion_depth--;
979  return 0; /* return value does not matter */
980 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
static int errordata_stack_depth
Definition: elog.c:142
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:748
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errfinish()

void errfinish ( int  dummy,
  ... 
)

Definition at line 413 of file elog.c.

References ErrorContextCallback::arg, ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, CritSectionCount, ErrorData::datatype_name, DestNone, DestRemote, ErrorData::detail, ErrorData::detail_log, elevel, ErrorData::elevel, EmitErrorReport(), ERROR, ErrorContext, errordata_stack_depth, FATAL, ErrorData::hint, ErrorData::internalquery, InterruptHoldoffCount, MemoryContextSwitchTo(), ErrorData::message, PANIC, pfree(), PG_exception_stack, PG_RE_THROW, pq_endcopyout, ErrorContextCallback::previous, proc_exit(), QueryCancelHoldoffCount, recursion_depth, ErrorData::schema_name, ErrorData::table_name, and whereToSendOutput.

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

414 {
416  int elevel;
417  MemoryContext oldcontext;
418  ErrorContextCallback *econtext;
419 
420  recursion_depth++;
422  elevel = edata->elevel;
423 
424  /*
425  * Do processing in ErrorContext, which we hope has enough reserved space
426  * to report an error.
427  */
428  oldcontext = MemoryContextSwitchTo(ErrorContext);
429 
430  /*
431  * Call any context callback functions. Errors occurring in callback
432  * functions will be treated as recursive errors --- this ensures we will
433  * avoid infinite recursion (see errstart).
434  */
435  for (econtext = error_context_stack;
436  econtext != NULL;
437  econtext = econtext->previous)
438  econtext->callback(econtext->arg);
439 
440  /*
441  * If ERROR (not more nor less) we pass it off to the current handler.
442  * Printing it and popping the stack is the responsibility of the handler.
443  */
444  if (elevel == ERROR)
445  {
446  /*
447  * We do some minimal cleanup before longjmp'ing so that handlers can
448  * execute in a reasonably sane state.
449  *
450  * Reset InterruptHoldoffCount in case we ereport'd from inside an
451  * interrupt holdoff section. (We assume here that no handler will
452  * itself be inside a holdoff section. If necessary, such a handler
453  * could save and restore InterruptHoldoffCount for itself, but this
454  * should make life easier for most.)
455  */
458 
459  CritSectionCount = 0; /* should be unnecessary, but... */
460 
461  /*
462  * Note that we leave CurrentMemoryContext set to ErrorContext. The
463  * handler should reset it to something else soon.
464  */
465 
466  recursion_depth--;
467  PG_RE_THROW();
468  }
469 
470  /*
471  * If we are doing FATAL or PANIC, abort any old-style COPY OUT in
472  * progress, so that we can report the message before dying. (Without
473  * this, pq_putmessage will refuse to send the message at all, which is
474  * what we want for NOTICE messages, but not for fatal exits.) This hack
475  * is necessary because of poor design of old-style copy protocol. Note
476  * we must do this even if client is fool enough to have set
477  * client_min_messages above FATAL, so don't look at output_to_client.
478  */
479  if (elevel >= FATAL && whereToSendOutput == DestRemote)
480  pq_endcopyout(true);
481 
482  /* Emit the message to the right places */
483  EmitErrorReport();
484 
485  /* Now free up subsidiary data attached to stack entry, and release it */
486  if (edata->message)
487  pfree(edata->message);
488  if (edata->detail)
489  pfree(edata->detail);
490  if (edata->detail_log)
491  pfree(edata->detail_log);
492  if (edata->hint)
493  pfree(edata->hint);
494  if (edata->context)
495  pfree(edata->context);
496  if (edata->schema_name)
497  pfree(edata->schema_name);
498  if (edata->table_name)
499  pfree(edata->table_name);
500  if (edata->column_name)
501  pfree(edata->column_name);
502  if (edata->datatype_name)
503  pfree(edata->datatype_name);
504  if (edata->constraint_name)
505  pfree(edata->constraint_name);
506  if (edata->internalquery)
507  pfree(edata->internalquery);
508 
510 
511  /* Exit error-handling context */
512  MemoryContextSwitchTo(oldcontext);
513  recursion_depth--;
514 
515  /*
516  * Perform error recovery action as specified by elevel.
517  */
518  if (elevel == FATAL)
519  {
520  /*
521  * For a FATAL error, we let proc_exit clean up and exit.
522  *
523  * If we just reported a startup failure, the client will disconnect
524  * on receiving it, so don't send any more to the client.
525  */
528 
529  /*
530  * fflush here is just to improve the odds that we get to see the
531  * error message, in case things are so hosed that proc_exit crashes.
532  * Any other code you might be tempted to add here should probably be
533  * in an on_proc_exit or on_shmem_exit callback instead.
534  */
535  fflush(stdout);
536  fflush(stderr);
537 
538  /*
539  * Do normal process-exit cleanup, then return exit code 1 to indicate
540  * FATAL termination. The postmaster may or may not consider this
541  * worthy of panic, depending on which subprocess returns it.
542  */
543  proc_exit(1);
544  }
545 
546  if (elevel >= PANIC)
547  {
548  /*
549  * Serious crash time. Postmaster will observe SIGABRT process exit
550  * status and kill the other backends too.
551  *
552  * XXX: what if we are *in* the postmaster? abort() won't kill our
553  * children...
554  */
555  fflush(stdout);
556  fflush(stderr);
557  abort();
558  }
559 
560  /*
561  * Check for cancel/die interrupt first --- this is so that the user can
562  * stop a query emitting tons of notice or warning messages, even if it's
563  * in a loop that otherwise fails to check for interrupts.
564  */
566 }
char * schema_name
Definition: elog.h:349
volatile uint32 InterruptHoldoffCount
Definition: globals.c:35
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
MemoryContext ErrorContext
Definition: mcxt.c:44
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:36
void proc_exit(int code)
Definition: ipc.c:99
static int recursion_depth
Definition: elog.c:144
char * internalquery
Definition: elog.h:356
void(* callback)(void *arg)
Definition: elog.h:239
struct ErrorContextCallback * previous
Definition: elog.h:238
#define PANIC
Definition: elog.h:53
ErrorContextCallback * error_context_stack
Definition: elog.c:88
void pfree(void *pointer)
Definition: mcxt.c:936
static int errordata_stack_depth
Definition: elog.c:142
#define ERROR
Definition: elog.h:43
char * detail_log
Definition: elog.h:345
#define FATAL
Definition: elog.h:52
Definition: dest.h:88
char * table_name
Definition: elog.h:350
volatile uint32 CritSectionCount
Definition: globals.c:37
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
char * datatype_name
Definition: elog.h:352
int elevel
Definition: elog.h:331
static int elevel
Definition: vacuumlazy.c:136
char * detail
Definition: elog.h:344
void EmitErrorReport(void)
Definition: elog.c:1446
char * column_name
Definition: elog.h:351
char * hint
Definition: elog.h:346
#define pq_endcopyout(errorAbort)
Definition: libpq.h:47
#define PG_RE_THROW()
Definition: elog.h:314
char * context
Definition: elog.h:347
sigjmp_buf * PG_exception_stack
Definition: elog.c:90
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:98
CommandDest whereToSendOutput
Definition: postgres.c:88
char * constraint_name
Definition: elog.h:353
char * message
Definition: elog.h:343

◆ errfunction()

int errfunction ( const char *  funcname)

Definition at line 1108 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::funcname, and ErrorData::show_funcname.

1109 {
1111 
1112  /* we don't bother incrementing recursion_depth */
1114 
1115  edata->funcname = funcname;
1116  edata->show_funcname = true;
1117 
1118  return 0; /* return value does not matter */
1119 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
const char * funcname
Definition: elog.h:339
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
bool show_funcname
Definition: elog.h:334

◆ errhidecontext()

int errhidecontext ( bool  hide_ctx)

Definition at line 1087 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_ctx.

1088 {
1090 
1091  /* we don't bother incrementing recursion_depth */
1093 
1094  edata->hide_ctx = hide_ctx;
1095 
1096  return 0; /* return value does not matter */
1097 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
bool hide_ctx
Definition: elog.h:336
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errhidestmt()

int errhidestmt ( bool  hide_stmt)

Definition at line 1068 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_stmt.

Referenced by exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), and explain_ExecutorEnd().

1069 {
1071 
1072  /* we don't bother incrementing recursion_depth */
1074 
1075  edata->hide_stmt = hide_stmt;
1076 
1077  return 0; /* return value does not matter */
1078 }
bool hide_stmt
Definition: elog.h:335
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errhint()

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

Definition at line 987 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_pagedel(), _hash_checkpage(), _hash_doinsert(), aclparse(), addTargetToSortList(), AlterEventTriggerOwner_internal(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner_internal(), AlterPublicationOwner_internal(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), analyzeCTE(), apw_start_database_worker(), apw_start_master_worker(), assign_collations_walker(), assign_hypothetical_collations(), asyncQueueFillWarning(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecChangeOwner(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecSetRelOptions(), ATExecSetStatistics(), ATPrepAlterColumnType(), ATPrepDropNotNull(), ATPrepSetNotNull(), autovac_init(), b64_decode(), BackendRun(), BeginCopyFrom(), BeginCopyTo(), 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_enable_rls(), check_lateral_ref_ok(), check_publication_add_relation(), check_stack_depth(), check_strxfrm_bug(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckMyDatabase(), CheckpointerMain(), CheckRequiredParameterValues(), CheckValidResultRel(), compileTheLexeme(), ComputeIndexAttrs(), ComputePartitionAttrs(), connect_pg_server(), cookDefault(), CopyFrom(), CopyReadLineText(), create_ctas_nodata(), create_tablespace_directories(), CreateAccessMethod(), CreateAnonymousSegment(), createdb(), CreateEventTrigger(), CreateForeignDataWrapper(), CreateFunction(), CreateLockFile(), CreatePredicateLock(), CreateProceduralLanguage(), CreateTableSpace(), CreateTrigger(), DateTimeParseError(), dblink_fdw_validator(), dblink_res_error(), dblink_security_check(), DeadLockReport(), DefineQueryRewrite(), DefineView(), DefineVirtualRelation(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_to_timestamp(), DoCopy(), DropErrorMsgWrongType(), DropSubscription(), dsm_backend_startup(), error_commit_ts_disabled(), errorMissingColumn(), errorMissingRTE(), EvaluateParams(), exec_prepare_plan(), exec_stmt_case(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), ExecDelete(), ExecGrant_Type(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecRefreshMatView(), ExecUpdate(), execute_extension_script(), ExecuteDoStmt(), ExecuteTruncate(), 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(), Generic_Text_IC_like(), get_object_address_defacl(), get_raw_page(), get_required_extension(), get_sort_group_operators(), getInstallationPaths(), GetNewMultiXactId(), GetNewTransactionId(), GetSerializableTransactionSnapshot(), GetTupleForTrigger(), gin_clean_pending_list(), ginCombineData(), ginNewScanKey(), gistbulkdelete(), gistcheckpage(), gistdoinsert(), gistUserPicksplit(), heap_create_with_catalog(), heap_truncate_check_FKs(), InitPostgres(), internal_load_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), intorel_startup(), IpcSemaphoreInitialize(), json_build_object(), jsonb_build_object(), like_fixed_prefix(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LogChildExit(), logicalrep_typmap_getid(), logicalrep_worker_launch(), LookupFuncName(), macaddr8tomacaddr(), make_row_comparison_op(), MarkAsPreparing(), MatchText(), mdextend(), mdwrite(), MergeAttributes(), movedb(), OldSerXidAdd(), OnConflict_CheckForSerializationFailure(), op_error(), parse_and_validate_value(), parse_hba_line(), parse_sane_timezone(), ParseFuncOrColumn(), parserOpenTable(), pg_create_restore_point(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_is_wal_replay_paused(), pg_newlocale_from_collation(), pg_prewarm(), pg_set_regex_collation(), pg_size_bytes(), pg_stop_backup(), pg_stop_backup_v2(), pg_switch_wal(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_archiveXlog(), pgfdw_report_error(), PGSharedMemoryCreate(), pgstat_reset_shared_counters(), PLy_elog_impl(), PLy_output(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyString_ToComposite(), policy_role_list_to_array(), populate_array_report_expected_array(), populate_record_worker(), populate_recordset_worker(), PortalRunSelect(), postgres_fdw_validator(), postgresql_fdw_validator(), PostmasterMain(), PreCommit_CheckForSerializationFailure(), PrepareRedoAdd(), ProcedureCreate(), process_owned_by(), process_postgres_switches(), ProcessInterrupts(), ProcessStartupPacket(), px_THROW_ERROR(), quickdie(), range_parse_flags(), RangeVarCallbackForAlterRelation(), ReadBuffer_common(), ReadControlFile(), readRecoveryCommandFile(), readTimeLineHistory(), recoveryPausesHere(), recursive_revoke(), regexp_match(), RegisterBackgroundWorker(), regoperatorin(), ReleaseOneSerializableXact(), RemoveObjects(), RenameType(), ReplicationSlotCreate(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_session_setup(), reportDependentObjects(), RequestCheckpoint(), ResolveOpClass(), RestoreSlotFromDisk(), RewriteQuery(), rewriteTargetListIU(), rewriteTargetView(), ri_FetchConstraintInfo(), ri_PerformCheck(), select_common_collation(), sendDir(), SetMultiXactIdLimit(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), SetTransactionIdLimit(), setup_background_workers(), similar_escape(), spgdoinsert(), spgFormInnerTuple(), StartupXLOG(), str_initcap(), str_tolower(), str_toupper(), StreamServerPort(), SysLogger_Start(), tblspc_redo(), text_format(), to_regoperator(), transformArrayExpr(), transformArraySubscripts(), transformAssignedExpr(), transformAssignmentIndirection(), transformCaseExpr(), transformCoalesceExpr(), transformInsertRow(), transformOnConflictArbiter(), transformPartitionBoundValue(), transformRangeFunction(), transformSetOperationStmt(), transformWindowDefinitions(), vacuum_set_xid_limits(), ValidatePgVersion(), varstr_cmp(), varstr_sortsupport(), VirtualXactLock(), worker_spi_launch(), and xml_is_document().

988 {
990  MemoryContext oldcontext;
991 
992  recursion_depth++;
994  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
995 
996  EVALUATE_MESSAGE(edata->domain, hint, false, true);
997 
998  MemoryContextSwitchTo(oldcontext);
999  recursion_depth--;
1000  return 0; /* return value does not matter */
1001 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errmsg()

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

Definition at line 797 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by _arrq_cons(), _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_pagedel(), _crypt_blowfish_rn(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_first(), _hash_init(), _hash_ovflblkno_to_bitno(), _intbig_in(), _intbig_out(), _lca(), _lt_q_regex(), _ltree_compress(), _mdfd_getseg(), _mdnblocks(), _PG_init(), _ShowOption(), _SPI_execute_plan(), _tarReadRaw(), _tarWriteHeader(), AbortBufferIO(), abstime2tm(), abstime_date(), abstime_timestamp(), abstime_timestamptz(), accumArrayResultArr(), aclcheck_error(), aclcheck_error_col(), aclinsert(), aclitemin(), aclparse(), aclremove(), acquire_inherited_sample_rows(), acquire_sample_rows(), add_json(), add_jsonb(), add_parameter_name(), add_reloption_kind(), add_rte_to_flat_rtable(), add_size(), addCompoundAffixFlagValue(), AddEnumLabel(), addFamilyMember(), AddQual(), addRangeTableEntryForCTE(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForSubquery(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRoleMems(), addTargetToSortList(), AddToDataDirLockFile(), AdjustIntervalForTypmod(), AdjustTimestampForTypmod(), advance_windowaggregate(), AfterTriggerSetState(), AggregateCreate(), alen_object_start(), alen_scalar(), AllocateDir(), AllocateFile(), AllocateVfd(), AllocSetContextCreateExtended(), AlterCollation(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainAddConstraint(), AlterDomainDropConstraint(), AlterDomainNotNull(), 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(), AlterPublicationOwner(), AlterPublicationOwner_internal(), AlterPublicationOwner_oid(), AlterPublicationTables(), AlterRelationNamespaceInternal(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSequence(), AlterSubscription(), AlterSubscription_refresh(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), AlterSubscriptionOwner_oid(), AlterSystemSetConfigFile(), AlterTableMoveAll(), AlterTableNamespace(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTypeNamespace(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterUserMapping(), analyze_rel(), analyzeCTE(), analyzeCTETargetList(), anyarray_in(), anyarray_recv(), anybit_typmodin(), anychar_typmodin(), anyenum_in(), anyrange_in(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_delete(), apply_handle_origin(), apply_typmod(), ApplyLauncherMain(), ApplyLogicalMappingFile(), ApplyWorkerMain(), apw_dump_now(), apw_load_buffers(), apw_start_database_worker(), apw_start_master_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), 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_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assign_xlog_sync_method(), assignOperTypes(), assignProcTypes(), AssignTypeArrayOid(), Async_Notify(), asyncQueueFillWarning(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepDropColumn(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetStatistics(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), ATWrongRelkindError(), auth_failed(), autoinc(), autoprewarm_database_main(), autoprewarm_main(), autoprewarm_start_worker(), autovac_init(), AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMain(), b64_decode(), backend_read_statsfile(), BackendInitialize(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFilePerm(), be_lo_close(), be_lo_export(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), BeginCopy(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), BootStrapXLOG(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_check(), bt_index_check_internal(), bt_metap(), bt_page_items(), bt_page_items_bytea(), bt_page_stats(), bt_right_page_check_scankey(), bt_target_page_check(), btree_index_checkable(), btvalidate(), BufFileOpenShared(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), build_row_from_class(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), calculate_relation_size(), calculate_tablespace_size(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), CancelBackup(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), cfread(), changeDependencyFor(), ChangeToDataDir(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_circularity(), check_conn_params(), check_default_allows_bound(), check_default_tablespace(), 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_is_member_of_role(), check_lateral_ref_ok(), check_new_partition_bound(), check_object_ownership(), check_of_type(), check_parameter_resolution_walker(), check_password(), check_permissions(), check_primary_key(), check_publication_add_relation(), check_relation_privileges(), check_relation_relkind(), check_relation_updatable(), check_restricted_library_name(), check_rolespec_name(), check_sql_fn_retval(), check_srf_call_placement(), check_stack_depth(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_usermap(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForStandbyTrigger(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckPredicate(), CheckRADIUSAuth(), CheckRecoveryConflictDeadlock(), CheckRecoveryConsistency(), CheckRequiredParameterValues(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), checkTimeLineSwitch(), CheckTransactionChain(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), CheckXLogRemoved(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), cleanup_tsquery_stopwords(), ClientAuthentication(), close_lb(), close_sl(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), colNameToVar(), CommandCounterIncrement(), CommentObject(), CompactCheckpointerRequestQueue(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_attributes_sql_style(), compute_attributes_with_style(), compute_common_attribute(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConnCreate(), connect_pg_server(), connectby_text(), connectby_text_serial(), construct_md_array(), ConversionCreate(), convert_and_check_filename(), convert_any_priv_string(), convert_column_name(), convert_function_name(), convert_priv_string(), convert_type_name(), convertJsonbArray(), convertJsonbObject(), ConvertTriggerToFK(), cookConstraint(), cookDefault(), copy_file(), copy_heap_data(), copy_relation_data(), copy_table(), copydir(), CopyFrom(), CopyGetAttnums(), CopyGetData(), CopyReadAttributesCSV(), CopyReadAttributesText(), CopyReadBinaryAttribute(), CopyReadLineText(), CopySendEndOfRow(), count_nondeletable_pages(), count_usable_fds(), create_ctas_nodata(), create_distinct_paths(), create_grouping_paths(), create_proc_lang(), create_tablespace_directories(), create_toast_table(), CreateAccessMethod(), CreateAnonymousSegment(), CreateCast(), CreateCheckPoint(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateReplicationSlot(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateSlotOnDisk(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_coord(), cube_coord_llur(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dasin(), dasind(), date2timestamp(), date2timestamptz(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_dir_size(), db_encoding_convert(), dbase_redo(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), 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(), DebugFileOpen(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), 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(), deflist_to_tuplestore(), DeleteAllExportedSnapshotFiles(), deleteConnection(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_autovacuum(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_start_bgworker(), do_to_timestamp(), DoCopy(), does_not_exist_skipping(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_cleanup_for_mmap(), dsm_create(), dsm_impl_can_resize(), dsm_impl_mmap(), dsm_impl_pin_segment(), dsm_impl_sysv(), dsm_impl_unpin_segment(), dsm_postmaster_shutdown(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), durable_link_or_rename(), durable_rename(), durable_unlink(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker(), each_worker_jsonb(), ean2isn(), ean2string(), ECPGconnect(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), emit_precedence_warnings(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EndCopy(), EndPrepare(), EndTransactionBlock(), enforce_generic_type_consistency(), 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(), error_commit_ts_disabled(), error_duplicate_filter_variable(), errorMissingColumn(), errorMissingRTE(), esc_dec_len(), esc_decode(), EvalPlanQualFetch(), EvalPlanQualFetchRowMarks(), EvaluateParams(), exec_assign_value(), exec_bind_message(), 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_object_restorecon(), exec_parse_message(), exec_prepare_plan(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_block(), 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(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecCallTriggerFunc(), ExecCheckHeapTupleVisible(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecConstraints(), ExecCreateTableAs(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalArrayRefSubscript(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecHashJoinGetSavedTuple(), ExecHashJoinNewBatch(), ExecHashJoinSaveTuple(), ExecInitAgg(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInsert(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheck(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteRecoveryCommand(), ExecuteTruncate(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), existsTimeLineHistory(), exitArchiveRecovery(), exp_var(), expand_col_privileges(), ExpandAllTables(), ExpandColumnRefStar(), explain_ExecutorEnd(), ExplainQuery(), ExportSnapshot(), exprType(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), fetch_remote_table_info(), fetch_table_list(), FetchDynamicTimeZone(), FetchPreparedStatement(), file_acquire_sample_rows(), file_exists(), file_fdw_validator(), fileAnalyzeForeignTable(), FileWrite(), fill_hba_view(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_dynamic_libpath(), find_provider(), find_typed_table_dependencies(), findDependentObjects(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), float48div(), float4_numeric(), float4div(), float4in(), float84div(), float8_numeric(), float8_timestamptz(), float8div(), float8in_internal(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), ForgetBackgroundWorker(), forkname_to_number(), free_parsestate(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), fsm_page_contents(), fsync_fname_ext(), ftoi2(), ftoi4(), ftoi8(), gbtreekey_in(), gbtreekey_out(), gc_qtexts(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), get_am_type_oid(), get_cast_oid(), get_cfp_error(), get_collation_actual_version(), get_collation_oid(), get_connect_string(), get_controlfile(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_encoding_name_for_icu(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), 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_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page(), get_raw_page_internal(), 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_rte_attribute_type(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), 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(), getAffixFlagSet(), getAnotherTuple(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), getdatafield(), GetDefaultOpClass(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), getInstallationPaths(), getlen(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetOldFunctionMessage(), getParamDescriptions(), GetPublicationByName(), getRowDescriptions(), GetRunningTransactionData(), GetSafeSnapshot(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), GetSQLCurrentDate(), GetSQLCurrentTime(), GetSQLLocalTime(), gettoken_query(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginCombineData(), GinFormTuple(), ginNewScanKey(), ginvalidate(), gistbulkdelete(), gistcheckpage(), gistdoinsert(), gistSplit(), gistUserPicksplit(), gistvalidate(), gistValidateBufferingOption(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleChildCrash(), HandleFunctionRequest(), HandleParallelMessages(), 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_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_scalar(), hash_search_with_hash_value(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_form_minimal_tuple(), heap_form_tuple(), heap_inplace_update(), heap_lock_tuple(), heap_open(), heap_openrv(), heap_openrv_extended(), heap_page_items(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_update(), heap_xlog_logical_rewrite(), hex2_to_uchar(), hex_decode(), hlparsetext(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), ident_inet(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), incompatible_module_error(), index_build(), index_check_primary_key(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_open(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), init_sql_fcache(), initArrayResultArr(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), InitWalSenderSlot(), inner_subltree(), insert_username(), InsertRule(), 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(), int4inc(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8inc(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_flush(), internal_get_result_type(), internal_inetpl(), internal_load_library(), internal_unload_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), interpret_AS_clause(), interpret_func_parallel(), interpret_function_parameter_list(), interpretOidsOption(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), issue_xlog_fsync(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_set(), JsValueToJsObject(), KeepFileRestoredFromArchive(), LargeObjectDrop(), lastval(), lazy_cleanup_index(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_create_slot(), libpqrcv_endstreaming(), libpqrcv_exec(), libpqrcv_get_conninfo(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), libpqrcv_receive(), libpqrcv_send(), libpqrcv_startstreaming(), like_fixed_prefix(), line_in(), ln_var(), lo_get_fragment_internal(), lo_import_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_ident(), load_libraries(), load_relmap_file(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), log_disconnections(), LogChildExit(), logfile_open(), logfile_rotate(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), logicalrep_rel_open(), logicalrep_typmap_getid(), logicalrep_worker_attach(), logicalrep_worker_launch(), LogicalRepApplyLoop(), LogicalRepSyncTableStart(), lookup_agg_function(), lookup_fdw_handler_func(), lookup_index_am_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), ltree_to_plpython(), ltsReadBlock(), ltsWriteBlock(), ltxtq_out(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), main(), make_absolute_path(), make_bound_box(), make_date(), make_distinct_op(), make_interval(), make_op(), make_outerjoininfo(), make_pathkeys_for_window(), make_result(), 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(), makeArrayTypeName(), makepol(), makeRangeVarFromNameList(), map_sql_value_to_xml_value(), MarkAsPreparing(), MarkPortalActive(), MatchText(), materializeResult(), maybe_reread_subscription(), md5_bytea(), md5_text(), mdcreate(), mdextend(), mdimmedsync(), mdopen(), mdpostckpt(), mdread(), mdsync(), mdtruncate(), mdunlinkfork(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), ModifyWaitEvent(), movedb(), mul_size(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), nonexclusive_base_backup_cleanup(), NonFiniteTimestampTzPart(), NUM_processor(), NUMDesc_prepare(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4(), numeric_int8(), numeric_power(), numeric_recv(), numeric_to_double_no_overflow(), numerictypmodin(), numericvar_to_double_no_overflow(), numericvar_to_int32(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), OldSerXidAdd(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum(), page_header(), PageAddItemExtended(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageIsVerified(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_extension_control_file(), parse_fcall_arguments(), parse_fcall_arguments_20(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_key_value_arrays(), parse_one_reloption(), parse_output_parameters(), parse_phrase_operator(), parse_publication_options(), parse_re_flags(), parse_sane_timezone(), parse_snapshot(), parse_subscription_options(), parse_tsquery(), parseCheckAggregates(), parseCreateReplSlotOptions(), ParseFuncOrColumn(), parseIntFromText(), parseNameAndArgTypes(), parseRelOptions(), parserOpenTable(), parsetext(), parsetinterval(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenFilePerm(), PathNameOpenTemporaryFile(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformAuthentication(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), PerformRadiusTransaction(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_be_scram_build_verifier(), pg_be_scram_exchange(), pg_be_scram_init(), pg_cancel_backend(), pg_char_to_encoding(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_ddl_command_in(), pg_ddl_command_out(), pg_ddl_command_recv(), pg_ddl_command_send(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_dlerror(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_ownercheck(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_extension_update_paths(), pg_file_rename(), pg_file_unlink(), pg_file_write(), pg_flush_data(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_serial_sequence(), pg_hba_file_rules(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), pg_logdir_ls(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_ls_dir_files(), pg_lsn_in(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_ndistinct_in(), pg_ndistinct_recv(), pg_newlocale_from_collation(), pg_node_tree_in(), pg_node_tree_recv(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_prepared_statement(), pg_prewarm(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_publication_ownercheck(), pg_random_bytes(), pg_read_binary_file(), pg_read_file(), pg_reload_conf(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_rotate_logfile(), pg_saslprep(), pg_sequence_last_value(), pg_sequence_parameters(), pg_set_regex_collation(), pg_show_replication_origin_status(), pg_signal_backend(), pg_size_bytes(), pg_start_backup(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_progress_info(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pg_stat_statements_reset(), pg_statistics_object_ownercheck(), pg_stop_backup(), pg_stop_backup_v2(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_databases(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_tzenumerate_next(), pg_tzenumerate_start(), pg_visibility(), pg_visibility_map(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_ArchiverCopyLoop(), pgarch_archiveXlog(), pgarch_start(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), pgrowlocks(), PGSemaphoreCreate(), PGSemaphoreLock(), PGSemaphoreTryLock(), PGSemaphoreUnlock(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_init(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_recv_dropdb(), pgstat_relation(), pgstat_reset_shared_counters(), pgstat_start(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PgstatCollectorMain(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), pgwin32_create_signal_listener(), placeChar(), 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_trigger_handler(), plperl_trusted_init(), plperl_untrusted_init(), plperl_validator(), plpgsql_build_variable(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_exec_trigger(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_resolve_polymorphic_argtypes(), plpgsql_validator(), plpgsql_yyerror(), plpython_to_hstore(), pltcl_build_tuple_result(), pltcl_elog(), pltcl_func_handler(), pltcl_trigger_handler(), PLy_abort_open_subtransactions(), PLy_cursor_fetch(), PLy_exec_function(), PLy_exec_trigger(), PLy_function_build_args(), PLy_initialize(), PLy_modify_tuple(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyObject_AsString(), PLySequence_ToArray_recurse(), PLySequence_ToComposite(), PLyString_ToComposite(), pmdie(), point_div(), policy_role_list_to_array(), poly_circle(), poly_distance(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_record_worker(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_validator(), postgresAcquireSampleRowsFunc(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), PostmasterStateMachine(), PostPrepare_Locks(), power_var(), power_var_int(), pq_copymsgbytes(), pq_getbyte_if_available(), pq_getmessage(), pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgrawstring(), pq_getmsgstring(), pq_getmsgtext(), pq_init(), pq_recvbuf(), pq_startmsgread(), PQsetvalue(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), PreCommit_Portals(), predicatelock_twophase_recover(), PrefetchBuffer(), prepare_sql_fn_parse_info(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventAdvisoryLocksInParallelMode(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventTransactionChain(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_matched_tle(), process_owned_by(), process_postgres_switches(), processCancelRequest(), ProcessCopyOptions(), ProcessGUCArray(), ProcessInterrupts(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), ProcessWalRcvInterrupts(), ProcSleep(), protect_out_of_mem(), prsd_headline(), prssyntaxerror(), publication_add_relation(), PublicationDropTables(), publicationListToArray(), pushquery(), PushTransaction(), pushval_asis(), pushValue(), pushValue_internal(), pvsnprintf(), px_crypt_des(), px_THROW_ERROR(), qtext_load_file(), qtext_store(), QTN2QT(), QualifiedNameGetCreationNamespace(), query_to_xml_internal(), queryin(), quickdie(), range_constructor3(), range_minus(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), 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_server_final_message(), read_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadBuffer_common(), ReadBufferExtended(), ReadCheckpointRecord(), ReadControlFile(), ReadDirExtended(), ReadRecord(), readRecoveryCommandFile(), readstoplist(), readTimeLineHistory(), readtup_heap(), ReadTwoPhaseFile(), reaper(), ReassignOwnedObjects(), ReceiveCopyBegin(), RecheckDataDirLockFile(), recompute_limits(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), recordDependencyOnCurrentExtension(), RecoverPreparedTransactions(), recoveryPausesHere(), recoveryStopsAfter(), recoveryStopsBefore(), RecreateTwoPhaseFile(), recursive_revoke(), recv_password_packet(), refresh_by_match_merge(), regex_fixed_prefix(), regexp_fixed_prefix(), regexp_match(), regexp_split_to_array(), regexp_split_to_table(), register_dirty_segment(), RegisterBackgroundWorker(), RegisterExtensibleNodeEntry(), RegisterTimeout(), regnamespacein(), regoperatorin(), regoperin(), regprocedurein(), regprocin(), regrolein(), reindex_index(), ReindexMultipleTables(), ReindexTable(), RelationBuildPartitionKey(), RelationCacheInitFilePreInvalidate(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), reltime_interval(), remove_dbtablespaces(), remove_tablespace_symlink(), RemoveAccessMethodById(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemovePolicyById(), RemoveRelations(), RemoveRoleFromObjectPolicy(), RemoveTriggerById(), RemoveTwoPhaseFile(), RemoveUserMapping(), RemoveXlogFile(), rename_constraint_internal(), rename_policy(), renameatt(), renameatt_check(), renameatt_internal(), RenameConstraint(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelation(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquire(), ReplicationSlotCreate(), ReplicationSlotDropPtr(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_invalid_token(), report_name_conflict(), report_namespace_conflict(), report_parse_error(), report_untranslatable_char(), reportDependentObjects(), ReportTemporaryFileUsage(), RequestCheckpoint(), requireSuperuser(), rescanLatestTimeLine(), reserveAllocatedDesc(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), resolve_column_ref(), resolve_generic_type(), resolve_unique_index_expr(), ResolveOpClass(), RestoreArchivedFile(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), RI_FKey_fk_upd_check_required(), RI_FKey_pk_upd_check_required(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), ri_restrict(), ri_setdefault(), ri_setnull(), RollbackToSavepoint(), rpad(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), SaveSlotToPath(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), scram_verify_plain_password(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_perl_context(), SendCopyBegin(), sendDir(), sendFile(), SendFunctionResult(), sendTablespace(), SendTimeLineHistory(), sepgsql_attribute_relabel(), sepgsql_audit_log(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_check_perms(), 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(), ServerLoop(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), SetMultiXactIdLimit(), SetOffsetVacuumLimit(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), SetSerializableTransactionSnapshot(), SetSessionAuthorization(), setTargetTable(), SetTransactionIdLimit(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), show_debug(), ShutdownXLOG(), SIGHUP_handler(), sigusr1_handler(), similar_escape(), SimpleLruTruncate(), SlabContextCreate(), SlruDeleteSegment(), SlruInternalDeleteSegment(), SlruPhysicalReadPage(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildInitialSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgvalidate(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), split_text(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutoVacLauncher(), StartAutovacuumWorker(), StartAutoVacWorker(), StartChildProcess(), StartLogicalReplication(), StartReplication(), StartupDecodingContext(), StartupReorderBuffer(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupXLOG(), statext_dependencies_deserialize(), statext_ndistinct_deserialize(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_numth(), str_tolower(), str_toupper(), StreamConnection(), StreamServerPort(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), substitute_libpath_macro(), suppress_redundant_updates_trigger(), SyncDataDirectory(), SyncRepInitConfig(), SyncRepReleaseWaiters(), SyncRepWaitForLSN(), SysLogger_Start(), SysLoggerMain(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), tablesample_init(), tablespace_list_append(), TablespaceCreateDbspace(), tblspc_redo(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), TestForOldSnapshot_impl(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_substring(), text_to_bits(), textarray_to_strvaluelist(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_part(), time_recv(), timestamp2timestamptz(), timestamp_abstime(), timestamp_age(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_abstime(), timestamptz_age(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc(), timestamptz_zone(), timetz_izone(), timetz_part(), timetz_recv(), timetz_zone(), tintervalrecv(), tliSwitchPoint(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), tokenize_file(), tokenize_inc_file(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformArrayExpr(), transformArraySubscripts(), transformArrayType(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), truncate_check_rel(), truncate_identifier(), TruncateMultiXact(), 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_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tuple_equals_slot(), tupledesc_match(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), txid_snapshot_recv(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_init(), unique_key_recheck(), unknown_attribute(), unlink_if_exists_fname(), UnlinkLockFiles(), update_metainfo_datafile(), UpdateControlFile(), UpdateMinRecoveryPoint(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vac_truncate_clog(), vacuum(), vacuum_rel(), vacuum_set_xid_limits(), validate_ddl_tags(), validate_option_array_item(), validate_pkattnums(), validate_table_rewrite_tags(), validateCheckConstraint(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateForeignKeyConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePartitionConstraints(), ValidatePgVersion(), ValidateRestrictionEstimator(), validateWithCheckOption(), ValidateXLOGDirectoryStructure(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_abbrev_convert(), varstr_cmp(), varstr_levenshtein(), varstr_sortsupport(), varstrfastcmp_locale(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_message(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitEventSetWait(), WaitForParallelWorkersToExit(), walkdir(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), WalSndCheckTimeOut(), WalSndLoop(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_file(), write_syslogger_file(), WriteControlFile(), WriteTempFileBlock(), writeTimeLineHistory(), writeTimeLineHistoryFile(), writetup_heap(), X509_NAME_field_to_text(), X509_NAME_to_text(), xlog_redo(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogPageRead(), XLogRead(), XlogReadTwoPhaseData(), XLogRestorePoint(), XLogWalRcvWrite(), XLogWrite(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

798 {
800  MemoryContext oldcontext;
801 
802  recursion_depth++;
804  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
805 
806  edata->message_id = fmt;
807  EVALUATE_MESSAGE(edata->domain, message, false, true);
808 
809  MemoryContextSwitchTo(oldcontext);
810  recursion_depth--;
811  return 0; /* return value does not matter */
812 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
const char * message_id
Definition: elog.h:348
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errmsg_internal()

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

Definition at line 827 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by _dosmaperr(), BackendInitialize(), BackendRun(), BackendStartup(), before_shmem_exit(), BeginCopy(), brinGetTupleForHeapBlock(), 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_srf_call_placement(), check_strxfrm_bug(), CheckSCRAMAuth(), ClosePostmasterPorts(), convert_tuples_by_name_map(), convert_tuples_by_position(), dblink_res_error(), elog_node_display(), elog_start(), errstart(), exec_replication_command(), exec_stmt_assert(), exec_stmt_raise(), ExecuteRecoveryCommand(), ExitPostmaster(), get_object_property_data(), GetErrorContextStack(), HandleChildCrash(), ident_inet(), index_create(), info_cb(), InitPostmasterDeathWatchHandle(), InsertOneValue(), inv_seek(), inv_truncate(), IpcSemaphoreInitialize(), lazy_vacuum_rel(), load_dh_buffer(), LoadKernel32(), on_proc_exit(), on_shmem_exit(), pg_tzenumerate_next(), pgarch_archiveXlog(), pgfdw_report_error(), pgwin32_recv(), pgwin32_signal_initialize(), pgwin32_socket_strerror(), pgwin32_waitforsinglesocket(), PLy_elog_impl(), PLy_output(), pmdie(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), processCancelRequest(), ReadRecord(), readRecoveryCommandFile(), reaper(), RegisterWaitForSingleObject(), reportDependentObjects(), RestoreArchivedFile(), ReThrowError(), setitimer(), ShowTransactionStateRec(), ShowUsage(), SignalSomeChildren(), SnapBuildFindSnapshot(), StartupXLOG(), statistic_proc_security_check(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), WalRcvFetchTimeLineHistoryFiles(), XLogWalRcvProcessMsg(), and xml_is_document().

828 {
830  MemoryContext oldcontext;
831 
832  recursion_depth++;
834  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
835 
836  edata->message_id = fmt;
837  EVALUATE_MESSAGE(edata->domain, message, false, false);
838 
839  MemoryContextSwitchTo(oldcontext);
840  recursion_depth--;
841  return 0; /* return value does not matter */
842 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
const char * message_id
Definition: elog.h:348
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ errmsg_plural()

int errmsg_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 850 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by AggregateCreate(), CheckpointerMain(), CheckPointTwoPhase(), exec_eval_expr(), ExecInitFunc(), ExecuteCallStmt(), func_select_candidate(), GetNewMultiXactId(), init_sexpr(), LookupFuncWithArgs(), ParseFuncOrColumn(), ProcedureCreate(), reportDependentObjects(), SetMultiXactIdLimit(), SnapBuildExportSnapshot(), and transformRangeTableSample().

852 {
854  MemoryContext oldcontext;
855 
856  recursion_depth++;
858  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
859 
860  edata->message_id = fmt_singular;
861  EVALUATE_MESSAGE_PLURAL(edata->domain, message, false);
862 
863  MemoryContextSwitchTo(oldcontext);
864  recursion_depth--;
865  return 0; /* return value does not matter */
866 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:144
static int errordata_stack_depth
Definition: elog.c:142
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:748
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
const char * message_id
Definition: elog.h:348
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340

◆ error_severity()

static const char * error_severity ( int  elevel)
static

Definition at line 3606 of file elog.c.

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

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

3607 {
3608  const char *prefix;
3609 
3610  switch (elevel)
3611  {
3612  case DEBUG1:
3613  case DEBUG2:
3614  case DEBUG3:
3615  case DEBUG4:
3616  case DEBUG5:
3617  prefix = gettext_noop("DEBUG");
3618  break;
3619  case LOG:
3620  case LOG_SERVER_ONLY:
3621  prefix = gettext_noop("LOG");
3622  break;
3623  case INFO:
3624  prefix = gettext_noop("INFO");
3625  break;
3626  case NOTICE:
3627  prefix = gettext_noop("NOTICE");
3628  break;
3629  case WARNING:
3630  prefix = gettext_noop("WARNING");
3631  break;
3632  case ERROR:
3633  prefix = gettext_noop("ERROR");
3634  break;
3635  case FATAL:
3636  prefix = gettext_noop("FATAL");
3637  break;
3638  case PANIC:
3639  prefix = gettext_noop("PANIC");
3640  break;
3641  default:
3642  prefix = "???";
3643  break;
3644  }
3645 
3646  return prefix;
3647 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
#define DEBUG1
Definition: elog.h:25
#define DEBUG3
Definition: elog.h:23
#define gettext_noop(x)
Definition: c.h:991
#define INFO
Definition: elog.h:33
#define LOG
Definition: elog.h:26
#define DEBUG4
Definition: elog.h:22
#define PANIC
Definition: elog.h:53
#define ERROR
Definition: elog.h:43
#define FATAL
Definition: elog.h:52
#define DEBUG2
Definition: elog.h:24
#define WARNING
Definition: elog.h:40
static int elevel
Definition: vacuumlazy.c:136
#define NOTICE
Definition: elog.h:37
#define DEBUG5
Definition: elog.h:20

◆ errposition()

int errposition ( int  cursorpos)

Definition at line 1125 of file elog.c.

References CHECK_STACK_DEPTH, ErrorData::cursorpos, and errordata_stack_depth.

Referenced by _SPI_error_callback(), executor_errposition(), function_parse_error_transpose(), import_error_callback(), parser_errposition(), pts_error_callback(), sql_exec_error_callback(), and sql_inline_error_callback().

1126 {
1128 
1129  /* we don't bother incrementing recursion_depth */
1131 
1132  edata->cursorpos = cursorpos;
1133 
1134  return 0; /* return value does not matter */
1135 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int cursorpos
Definition: elog.h:354
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errstart()

bool errstart ( int  elevel,
const char *  filename,
int  lineno,
const char *  funcname,
const char *  domain 
)

Definition at line 233 of file elog.c.

References ErrorData::assoc_context, client_min_messages, ClientAuthInProgress, ErrorData::context_domain, CritSectionCount, debug_query_string, DestRemote, ErrorData::domain, elevel, ErrorData::elevel, ereport, errmsg_internal(), ERROR, ErrorContext, errordata_stack_depth, ERRORDATA_STACK_SIZE, ExitOnAnyError, FATAL, filename, ErrorData::filename, ErrorData::funcname, i, in_error_recursion_trouble(), INFO, is_log_level_output(), ErrorData::lineno, log_min_messages, LOG_SERVER_ONLY, Max, MemoryContextReset(), MemSet, ErrorData::output_to_client, ErrorData::output_to_server, PANIC, PG_exception_stack, PG_TEXTDOMAIN, proc_exit_inprogress, recursion_depth, ErrorData::saved_errno, ErrorData::sqlerrcode, WARNING, whereToSendOutput, and write_stderr().

Referenced by elog_finish(), and ThrowErrorData().

235 {
236  ErrorData *edata;
237  bool output_to_server;
238  bool output_to_client = false;
239  int i;
240 
241  /*
242  * Check some cases in which we want to promote an error into a more
243  * severe error. None of this logic applies for non-error messages.
244  */
245  if (elevel >= ERROR)
246  {
247  /*
248  * If we are inside a critical section, all errors become PANIC
249  * errors. See miscadmin.h.
250  */
251  if (CritSectionCount > 0)
252  elevel = PANIC;
253 
254  /*
255  * Check reasons for treating ERROR as FATAL:
256  *
257  * 1. we have no handler to pass the error to (implies we are in the
258  * postmaster or in backend startup).
259  *
260  * 2. ExitOnAnyError mode switch is set (initdb uses this).
261  *
262  * 3. the error occurred after proc_exit has begun to run. (It's
263  * proc_exit's responsibility to see that this doesn't turn into
264  * infinite recursion!)
265  */
266  if (elevel == ERROR)
267  {
268  if (PG_exception_stack == NULL ||
269  ExitOnAnyError ||
271  elevel = FATAL;
272  }
273 
274  /*
275  * If the error level is ERROR or more, errfinish is not going to
276  * return to caller; therefore, if there is any stacked error already
277  * in progress it will be lost. This is more or less okay, except we
278  * do not want to have a FATAL or PANIC error downgraded because the
279  * reporting process was interrupted by a lower-grade error. So check
280  * the stack and make sure we panic if panic is warranted.
281  */
282  for (i = 0; i <= errordata_stack_depth; i++)
284  }
285 
286  /*
287  * Now decide whether we need to process this report at all; if it's
288  * warning or less and not enabled for logging, just return false without
289  * starting up any error logging machinery.
290  */
291 
292  /* Determine whether message is enabled for server log output */
293  output_to_server = is_log_level_output(elevel, log_min_messages);
294 
295  /* Determine whether message is enabled for client output */
297  {
298  /*
299  * client_min_messages is honored only after we complete the
300  * authentication handshake. This is required both for security
301  * reasons and because many clients can't handle NOTICE messages
302  * during authentication.
303  */
305  output_to_client = (elevel >= ERROR);
306  else
307  output_to_client = (elevel >= client_min_messages ||
308  elevel == INFO);
309  }
310 
311  /* Skip processing effort if non-error message will not be output */
312  if (elevel < ERROR && !output_to_server && !output_to_client)
313  return false;
314 
315  /*
316  * We need to do some actual work. Make sure that memory context
317  * initialization has finished, else we can't do anything useful.
318  */
319  if (ErrorContext == NULL)
320  {
321  /* Oops, hard crash time; very little we can do safely here */
322  write_stderr("error occurred at %s:%d before error message processing is available\n",
323  filename ? filename : "(unknown file)", lineno);
324  exit(2);
325  }
326 
327  /*
328  * Okay, crank up a stack entry to store the info in.
329  */
330 
331  if (recursion_depth++ > 0 && elevel >= ERROR)
332  {
333  /*
334  * Oops, error during error processing. Clear ErrorContext as
335  * discussed at top of file. We will not return to the original
336  * error's reporter or handler, so we don't need it.
337  */
339 
340  /*
341  * Infinite error recursion might be due to something broken in a
342  * context traceback routine. Abandon them too. We also abandon
343  * attempting to print the error statement (which, if long, could
344  * itself be the source of the recursive failure).
345  */
347  {
348  error_context_stack = NULL;
349  debug_query_string = NULL;
350  }
351  }
353  {
354  /*
355  * Wups, stack not big enough. We treat this as a PANIC condition
356  * because it suggests an infinite loop of errors during error
357  * recovery.
358  */
359  errordata_stack_depth = -1; /* make room on stack */
360  ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
361  }
362 
363  /* Initialize data for this error frame */
365  MemSet(edata, 0, sizeof(ErrorData));
366  edata->elevel = elevel;
367  edata->output_to_server = output_to_server;
368  edata->output_to_client = output_to_client;
369  if (filename)
370  {
371  const char *slash;
372 
373  /* keep only base name, useful especially for vpath builds */
374  slash = strrchr(filename, '/');
375  if (slash)
376  filename = slash + 1;
377  }
378  edata->filename = filename;
379  edata->lineno = lineno;
380  edata->funcname = funcname;
381  /* the default text domain is the backend's */
382  edata->domain = domain ? domain : PG_TEXTDOMAIN("postgres");
383  /* initialize context_domain the same way (see set_errcontext_domain()) */
384  edata->context_domain = edata->domain;
385  /* Select default errcode based on elevel */
386  if (elevel >= ERROR)
387  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
388  else if (elevel == WARNING)
389  edata->sqlerrcode = ERRCODE_WARNING;
390  else
391  edata->sqlerrcode = ERRCODE_SUCCESSFUL_COMPLETION;
392  /* errno is saved here so that error parameter eval can't change it */
393  edata->saved_errno = errno;
394 
395  /*
396  * Any allocations for this error state level should go into ErrorContext
397  */
398  edata->assoc_context = ErrorContext;
399 
400  recursion_depth--;
401  return true;
402 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
MemoryContext ErrorContext
Definition: mcxt.c:44
int sqlerrcode
Definition: elog.h:342
const char * funcname
Definition: elog.h:339
#define ERRORDATA_STACK_SIZE
Definition: elog.c:138
int lineno
Definition: elog.h:338
static int recursion_depth
Definition: elog.c:144
#define MemSet(start, val, len)
Definition: c.h:863
#define INFO
Definition: elog.h:33
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:134
#define PANIC
Definition: elog.h:53
ErrorContextCallback * error_context_stack
Definition: elog.c:88
bool ClientAuthInProgress
Definition: postmaster.c:350
const char * context_domain
Definition: elog.h:341
static int errordata_stack_depth
Definition: elog.c:142
#define ERROR
Definition: elog.h:43
const char * filename
Definition: elog.h:337
static bool is_log_level_output(int elevel, int log_min_level)
Definition: elog.c:3722
#define FATAL
Definition: elog.h:52
bool output_to_server
Definition: elog.h:332
int saved_errno
Definition: elog.h:357
volatile uint32 CritSectionCount
Definition: globals.c:37
#define ereport(elevel, rest)
Definition: elog.h:122
#define WARNING
Definition: elog.h:40
const char * debug_query_string
Definition: postgres.c:85
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
int elevel
Definition: elog.h:331
static int elevel
Definition: vacuumlazy.c:136
bool ExitOnAnyError
Definition: globals.c:105
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1009
int log_min_messages
Definition: guc.c:452
bool in_error_recursion_trouble(void)
Definition: elog.c:196
int errmsg_internal(const char *fmt,...)
Definition: elog.c:827
#define Max(x, y)
Definition: c.h:806
void write_stderr(const char *fmt,...)
Definition: elog.c:3676
bool proc_exit_inprogress
Definition: ipc.c:40
struct MemoryContextData * assoc_context
Definition: elog.h:360
sigjmp_buf * PG_exception_stack
Definition: elog.c:90
static char * filename
Definition: pg_dumpall.c:90
int i
int client_min_messages
Definition: guc.c:453
CommandDest whereToSendOutput
Definition: postgres.c:88
const char * domain
Definition: elog.h:340
bool output_to_client
Definition: elog.h:333

◆ expand_fmt_string()

static char * expand_fmt_string ( const char *  fmt,
ErrorData edata 
)
static

Definition at line 3342 of file elog.c.

References appendStringInfoCharMacro, buf, StringInfoData::data, initStringInfo(), ErrorData::saved_errno, and useful_strerror().

3343 {
3345  const char *cp;
3346 
3347  initStringInfo(&buf);
3348 
3349  for (cp = fmt; *cp; cp++)
3350  {
3351  if (cp[0] == '%' && cp[1] != '\0')
3352  {
3353  cp++;
3354  if (*cp == 'm')
3355  {
3356  /*
3357  * Replace %m by system error string. If there are any %'s in
3358  * the string, we'd better double them so that vsnprintf won't
3359  * misinterpret.
3360  */
3361  const char *cp2;
3362 
3363  cp2 = useful_strerror(edata->saved_errno);
3364  for (; *cp2; cp2++)
3365  {
3366  if (*cp2 == '%')
3367  appendStringInfoCharMacro(&buf, '%');
3368  appendStringInfoCharMacro(&buf, *cp2);
3369  }
3370  }
3371  else
3372  {
3373  /* copy % and next char --- this avoids trouble with %%m */
3374  appendStringInfoCharMacro(&buf, '%');
3375  appendStringInfoCharMacro(&buf, *cp);
3376  }
3377  }
3378  else
3379  appendStringInfoCharMacro(&buf, *cp);
3380  }
3381 
3382  return buf.data;
3383 }
static const char * useful_strerror(int errnum)
Definition: elog.c:3390
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:127
static char * buf
Definition: pg_test_fsync.c:67
int saved_errno
Definition: elog.h:357
void initStringInfo(StringInfo str)
Definition: stringinfo.c:46

◆ FlushErrorState()

void FlushErrorState ( void  )

Definition at line 1587 of file elog.c.

References ErrorContext, errordata_stack_depth, MemoryContextResetAndDeleteChildren, and recursion_depth.

Referenced by AutoVacLauncherMain(), BackgroundWriterMain(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), CheckpointerMain(), do_autovacuum(), exec_stmt_block(), initTrie(), perform_work_item(), plperl_return_next(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_util_elog(), pltcl_elog(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), PostgresMain(), WalWriterMain(), xml_is_document(), and xpath_exists().

1588 {
1589  /*
1590  * Reset stack to empty. The only case where it would be more than one
1591  * deep is if we serviced an error that interrupted construction of
1592  * another message. We assume control escaped out of that message
1593  * construction and won't ever go back.
1594  */
1595  errordata_stack_depth = -1;
1596  recursion_depth = 0;
1597  /* Delete all data in ErrorContext */
1599 }
MemoryContext ErrorContext
Definition: mcxt.c:44
static int recursion_depth
Definition: elog.c:144
static int errordata_stack_depth
Definition: elog.c:142
#define MemoryContextResetAndDeleteChildren(ctx)
Definition: memutils.h:67

◆ format_elog_string()

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

Definition at line 1413 of file elog.c.

References ErrorData::domain, ErrorContext, EVALUATE_MESSAGE, MemoryContextSwitchTo(), MemSet, ErrorData::message, ErrorData::message_id, PG_TEXTDOMAIN, save_format_domain, save_format_errnumber, and ErrorData::saved_errno.

1414 {
1415  ErrorData errdata;
1416  ErrorData *edata;
1417  MemoryContext oldcontext;
1418 
1419  /* Initialize a mostly-dummy error frame */
1420  edata = &errdata;
1421  MemSet(edata, 0, sizeof(ErrorData));
1422  /* the default text domain is the backend's */
1423  edata->domain = save_format_domain ? save_format_domain : PG_TEXTDOMAIN("postgres");
1424  /* set the errno to be used to interpret %m */
1426 
1427  oldcontext = MemoryContextSwitchTo(ErrorContext);
1428 
1429  edata->message_id = fmt;
1430  EVALUATE_MESSAGE(edata->domain, message, false, true);
1431 
1432  MemoryContextSwitchTo(oldcontext);
1433 
1434  return edata->message;
1435 }
MemoryContext ErrorContext
Definition: mcxt.c:44
static int save_format_errnumber
Definition: elog.c:1400
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
#define MemSet(start, val, len)
Definition: c.h:863
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:708
int saved_errno
Definition: elog.h:357
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1009
const char * message_id
Definition: elog.h:348
static const char * save_format_domain
Definition: elog.c:1401
const char * domain
Definition: elog.h:340
char * message
Definition: elog.h:343

◆ FreeErrorData()

void FreeErrorData ( ErrorData edata)

Definition at line 1551 of file elog.c.

References ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, ErrorData::datatype_name, ErrorData::detail, ErrorData::detail_log, ErrorData::hint, ErrorData::internalquery, ErrorData::message, pfree(), ErrorData::schema_name, and ErrorData::table_name.

Referenced by pltcl_elog(), pltcl_subtrans_abort(), PLy_output(), and PLy_spi_subtransaction_abort().

1552 {
1553  if (edata->message)
1554  pfree(edata->message);
1555  if (edata->detail)
1556  pfree(edata->detail);
1557  if (edata->detail_log)
1558  pfree(edata->detail_log);
1559  if (edata->hint)
1560  pfree(edata->hint);
1561  if (edata->context)
1562  pfree(edata->context);
1563  if (edata->schema_name)
1564  pfree(edata->schema_name);
1565  if (edata->table_name)
1566  pfree(edata->table_name);
1567  if (edata->column_name)
1568  pfree(edata->column_name);
1569  if (edata->datatype_name)
1570  pfree(edata->datatype_name);
1571  if (edata->constraint_name)
1572  pfree(edata->constraint_name);
1573  if (edata->internalquery)
1574  pfree(edata->internalquery);
1575  pfree(edata);
1576 }
char * schema_name
Definition: elog.h:349
char * internalquery
Definition: elog.h:356
void pfree(void *pointer)
Definition: mcxt.c:936
char * detail_log
Definition: elog.h:345
char * table_name
Definition: elog.h:350
char * datatype_name
Definition: elog.h:352
char * detail
Definition: elog.h:344
char * column_name
Definition: elog.h:351
char * hint
Definition: elog.h:346
char * context
Definition: elog.h:347
char * constraint_name
Definition: elog.h:353
char * message
Definition: elog.h:343

◆ get_errno_symbol()

static const char * get_errno_symbol ( int  errnum)
static

Definition at line 3431 of file elog.c.

References EADDRINUSE, EADDRNOTAVAIL, EAFNOSUPPORT, EAGAIN, ECONNABORTED, ECONNREFUSED, ECONNRESET, EHOSTUNREACH, EIDRM, EINPROGRESS, EINTR, EISCONN, EMSGSIZE, ENOBUFS, ENOTCONN, ENOTSOCK, ENOTSUP, EOPNOTSUPP, EOVERFLOW, EPROTONOSUPPORT, and EWOULDBLOCK.

Referenced by useful_strerror().

3432 {
3433  switch (errnum)
3434  {
3435  case E2BIG:
3436  return "E2BIG";
3437  case EACCES:
3438  return "EACCES";
3439 #ifdef EADDRINUSE
3440  case EADDRINUSE:
3441  return "EADDRINUSE";
3442 #endif
3443 #ifdef EADDRNOTAVAIL
3444  case EADDRNOTAVAIL:
3445  return "EADDRNOTAVAIL";
3446 #endif
3447  case EAFNOSUPPORT:
3448  return "EAFNOSUPPORT";
3449 #ifdef EAGAIN
3450  case EAGAIN:
3451  return "EAGAIN";
3452 #endif
3453 #ifdef EALREADY
3454  case EALREADY:
3455  return "EALREADY";
3456 #endif
3457  case EBADF:
3458  return "EBADF";
3459 #ifdef EBADMSG
3460  case EBADMSG:
3461  return "EBADMSG";
3462 #endif
3463  case EBUSY:
3464  return "EBUSY";
3465  case ECHILD:
3466  return "ECHILD";
3467 #ifdef ECONNABORTED
3468  case ECONNABORTED:
3469  return "ECONNABORTED";
3470 #endif
3471  case ECONNREFUSED:
3472  return "ECONNREFUSED";
3473 #ifdef ECONNRESET
3474  case ECONNRESET:
3475  return "ECONNRESET";
3476 #endif
3477  case EDEADLK:
3478  return "EDEADLK";
3479  case EDOM:
3480  return "EDOM";
3481  case EEXIST:
3482  return "EEXIST";
3483  case EFAULT:
3484  return "EFAULT";
3485  case EFBIG:
3486  return "EFBIG";
3487 #ifdef EHOSTUNREACH
3488  case EHOSTUNREACH:
3489  return "EHOSTUNREACH";
3490 #endif
3491  case EIDRM:
3492  return "EIDRM";
3493  case EINPROGRESS:
3494  return "EINPROGRESS";
3495  case EINTR:
3496  return "EINTR";
3497  case EINVAL:
3498  return "EINVAL";
3499  case EIO:
3500  return "EIO";
3501 #ifdef EISCONN
3502  case EISCONN:
3503  return "EISCONN";
3504 #endif
3505  case EISDIR:
3506  return "EISDIR";
3507 #ifdef ELOOP
3508  case ELOOP:
3509  return "ELOOP";
3510 #endif
3511  case EMFILE:
3512  return "EMFILE";
3513  case EMLINK:
3514  return "EMLINK";
3515  case EMSGSIZE:
3516  return "EMSGSIZE";
3517  case ENAMETOOLONG:
3518  return "ENAMETOOLONG";
3519  case ENFILE:
3520  return "ENFILE";
3521  case ENOBUFS:
3522  return "ENOBUFS";
3523  case ENODEV:
3524  return "ENODEV";
3525  case ENOENT:
3526  return "ENOENT";
3527  case ENOEXEC:
3528  return "ENOEXEC";
3529  case ENOMEM:
3530  return "ENOMEM";
3531  case ENOSPC:
3532  return "ENOSPC";
3533  case ENOSYS:
3534  return "ENOSYS";
3535 #ifdef ENOTCONN
3536  case ENOTCONN:
3537  return "ENOTCONN";
3538 #endif
3539  case ENOTDIR:
3540  return "ENOTDIR";
3541 #if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
3542  case ENOTEMPTY:
3543  return "ENOTEMPTY";
3544 #endif
3545 #ifdef ENOTSOCK
3546  case ENOTSOCK:
3547  return "ENOTSOCK";
3548 #endif
3549 #ifdef ENOTSUP
3550  case ENOTSUP:
3551  return "ENOTSUP";
3552 #endif
3553  case ENOTTY:
3554  return "ENOTTY";
3555  case ENXIO:
3556  return "ENXIO";
3557 #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (EOPNOTSUPP != ENOTSUP))
3558  case EOPNOTSUPP:
3559  return "EOPNOTSUPP";
3560 #endif
3561 #ifdef EOVERFLOW
3562  case EOVERFLOW:
3563  return "EOVERFLOW";
3564 #endif
3565  case EPERM:
3566  return "EPERM";
3567  case EPIPE:
3568  return "EPIPE";
3569  case EPROTONOSUPPORT:
3570  return "EPROTONOSUPPORT";
3571  case ERANGE:
3572  return "ERANGE";
3573 #ifdef EROFS
3574  case EROFS:
3575  return "EROFS";
3576 #endif
3577  case ESRCH:
3578  return "ESRCH";
3579 #ifdef ETIMEDOUT
3580  case ETIMEDOUT:
3581  return "ETIMEDOUT";
3582 #endif
3583 #ifdef ETXTBSY
3584  case ETXTBSY:
3585  return "ETXTBSY";
3586 #endif
3587 #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
3588  case EWOULDBLOCK:
3589  return "EWOULDBLOCK";
3590 #endif
3591  case EXDEV:
3592  return "EXDEV";
3593  }
3594 
3595  return NULL;
3596 }
#define ECONNABORTED
Definition: win32_port.h:342
#define EAGAIN
Definition: win32_port.h:332
#define ENOTSUP
Definition: private.h:35
#define ENOTSOCK
Definition: win32_port.h:356
#define EHOSTUNREACH
Definition: win32_port.h:364
#define EADDRNOTAVAIL
Definition: win32_port.h:362
#define ECONNREFUSED
Definition: win32_port.h:354
#define ENOTCONN
Definition: win32_port.h:366
#define EISCONN
Definition: win32_port.h:348
#define EIDRM
Definition: win32_port.h:90
#define EAFNOSUPPORT
Definition: win32_port.h:338
#define EPROTONOSUPPORT
Definition: win32_port.h:352
#define EADDRINUSE
Definition: win32_port.h:360
#define ECONNRESET
Definition: win32_port.h:344
#define EOPNOTSUPP
Definition: win32_port.h:358
#define ENOBUFS
Definition: win32_port.h:350
#define EINPROGRESS
Definition: win32_port.h:346
#define EWOULDBLOCK
Definition: win32_port.h:340
#define EINTR
Definition: win32_port.h:334
#define EMSGSIZE
Definition: win32_port.h:336
#define EOVERFLOW
Definition: private.h:38

◆ geterrcode()

int geterrcode ( void  )

Definition at line 1240 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by pcb_error_callback().

1241 {
1243 
1244  /* we don't bother incrementing recursion_depth */
1246 
1247  return edata->sqlerrcode;
1248 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int sqlerrcode
Definition: elog.h:342
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ GetErrorContextStack()

char* GetErrorContextStack ( void  )

Definition at line 1796 of file elog.c.

References ErrorContextCallback::arg, ErrorData::assoc_context, ErrorContextCallback::callback, ErrorData::context, CurrentMemoryContext, ereport, errmsg_internal(), errordata_stack_depth, ERRORDATA_STACK_SIZE, MemSet, PANIC, ErrorContextCallback::previous, and recursion_depth.

Referenced by exec_stmt_getdiag().

1797 {
1798  ErrorData *edata;
1799  ErrorContextCallback *econtext;
1800 
1801  /*
1802  * Okay, crank up a stack entry to store the info in.
1803  */
1804  recursion_depth++;
1805 
1807  {
1808  /*
1809  * Wups, stack not big enough. We treat this as a PANIC condition
1810  * because it suggests an infinite loop of errors during error
1811  * recovery.
1812  */
1813  errordata_stack_depth = -1; /* make room on stack */
1814  ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
1815  }
1816 
1817  /*
1818  * Things look good so far, so initialize our error frame
1819  */
1820  edata = &errordata[errordata_stack_depth];
1821  MemSet(edata, 0, sizeof(ErrorData));
1822 
1823  /*
1824  * Set up assoc_context to be the caller's context, so any allocations
1825  * done (which will include edata->context) will use their context.
1826  */
1828 
1829  /*
1830  * Call any context callback functions to collect the context information
1831  * into edata->context.
1832  *
1833  * Errors occurring in callback functions should go through the regular
1834  * error handling code which should handle any recursive errors, though we
1835  * double-check above, just in case.
1836  */
1837  for (econtext = error_context_stack;
1838  econtext != NULL;
1839  econtext = econtext->previous)
1840  econtext->callback(econtext->arg);
1841 
1842  /*
1843  * Clean ourselves off the stack, any allocations done should have been
1844  * using edata->assoc_context, which we set up earlier to be the caller's
1845  * context, so we're free to just remove our entry off the stack and
1846  * decrement recursion depth and exit.
1847  */
1849  recursion_depth--;
1850 
1851  /*
1852  * Return a pointer to the string the caller asked for, which should have
1853  * been allocated in their context.
1854  */
1855  return edata->context;
1856 }
#define ERRORDATA_STACK_SIZE
Definition: elog.c:138
static int recursion_depth
Definition: elog.c:144
#define MemSet(start, val, len)
Definition: c.h:863
void(* callback)(void *arg)
Definition: elog.h:239
struct ErrorContextCallback * previous
Definition: elog.h:238
#define PANIC
Definition: elog.h:53
ErrorContextCallback * error_context_stack
Definition: elog.c:88
static int errordata_stack_depth
Definition: elog.c:142
MemoryContext CurrentMemoryContext
Definition: mcxt.c:37
#define ereport(elevel, rest)
Definition: elog.h:122
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
int errmsg_internal(const char *fmt,...)
Definition: elog.c:827
char * context
Definition: elog.h:347
struct MemoryContextData * assoc_context
Definition: elog.h:360

◆ geterrposition()

int geterrposition ( void  )

Definition at line 1257 of file elog.c.

References CHECK_STACK_DEPTH, ErrorData::cursorpos, and errordata_stack_depth.

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), sql_exec_error_callback(), and sql_inline_error_callback().

1258 {
1260 
1261  /* we don't bother incrementing recursion_depth */
1263 
1264  return edata->cursorpos;
1265 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int cursorpos
Definition: elog.h:354
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ getinternalerrposition()

int getinternalerrposition ( void  )

Definition at line 1274 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by function_parse_error_transpose().

1275 {
1277 
1278  /* we don't bother incrementing recursion_depth */
1280 
1281  return edata->internalpos;
1282 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
int internalpos
Definition: elog.h:355
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ in_error_recursion_trouble()

bool in_error_recursion_trouble ( void  )

Definition at line 196 of file elog.c.

References recursion_depth.

Referenced by DebugFileOpen(), err_gettext(), err_sendstring(), errstart(), pgfdw_subxact_callback(), pgfdw_xact_callback(), and write_console().

197 {
198  /* Pull the plug if recurse more than once */
199  return (recursion_depth > 2);
200 }
static int recursion_depth
Definition: elog.c:144

◆ internalerrposition()

int internalerrposition ( int  cursorpos)

Definition at line 1141 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), plpgsql_scanner_errposition(), PLy_elog_impl(), sql_exec_error_callback(), and sql_inline_error_callback().

1142 {
1144 
1145  /* we don't bother incrementing recursion_depth */
1147 
1148  edata->internalpos = cursorpos;
1149 
1150  return 0; /* return value does not matter */
1151 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
int internalpos
Definition: elog.h:355
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ internalerrquery()

int internalerrquery ( const char *  query)

Definition at line 1161 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::internalquery, MemoryContextStrdup(), and pfree().

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), plpgsql_scanner_errposition(), PLy_elog_impl(), sql_exec_error_callback(), and sql_inline_error_callback().

1162 {
1164 
1165  /* we don't bother incrementing recursion_depth */
1167 
1168  if (edata->internalquery)
1169  {
1170  pfree(edata->internalquery);
1171  edata->internalquery = NULL;
1172  }
1173 
1174  if (query)
1175  edata->internalquery = MemoryContextStrdup(edata->assoc_context, query);
1176 
1177  return 0; /* return value does not matter */
1178 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
char * internalquery
Definition: elog.h:356
void pfree(void *pointer)
Definition: mcxt.c:936
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:360
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1050

◆ is_log_level_output()

static bool is_log_level_output ( int  elevel,
int  log_min_level 
)
static

Definition at line 3722 of file elog.c.

References ERROR, FATAL, LOG, and LOG_SERVER_ONLY.

Referenced by errstart(), pg_re_throw(), send_message_to_server_log(), and write_csvlog().

3723 {
3724  if (elevel == LOG || elevel == LOG_SERVER_ONLY)
3725  {
3726  if (log_min_level == LOG || log_min_level <= ERROR)
3727  return true;
3728  }
3729  else if (log_min_level == LOG)
3730  {
3731  /* elevel != LOG */
3732  if (elevel >= FATAL)
3733  return true;
3734  }
3735  /* Neither is LOG */
3736  else if (elevel >= log_min_level)
3737  return true;
3738 
3739  return false;
3740 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
#define LOG
Definition: elog.h:26
#define ERROR
Definition: elog.h:43
#define FATAL
Definition: elog.h:52
static int elevel
Definition: vacuumlazy.c:136

◆ log_line_prefix()

static void log_line_prefix ( StringInfo  buf,
ErrorData edata 
)
static

Definition at line 2318 of file elog.c.

References _, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), application_name, PGPROC::backendId, Port::database_name, dbname, formatted_log_time, formatted_start_time, get_ps_display(), gettimeofday(), GetTopTransactionIdIfAny(), InvalidBackendId, Log_line_prefix, log_timezone, PGPROC::lxid, MyProc, MyProcPid, MyProcPort, MyStartTime, pfree(), pg_localtime(), pg_strftime(), process_log_prefix_padding(), psprintf(), Port::remote_host, Port::remote_port, saved_timeval, saved_timeval_set, setup_formatted_log_time(), setup_formatted_start_time(), snprintf(), ErrorData::sqlerrcode, unpack_sql_state(), Port::user_name, and username.

Referenced by send_message_to_server_log().

2319 {
2320  /* static counter for line numbers */
2321  static long log_line_number = 0;
2322 
2323  /* has counter been reset in current process? */
2324  static int log_my_pid = 0;
2325  int padding;
2326  const char *p;
2327 
2328  /*
2329  * This is one of the few places where we'd rather not inherit a static
2330  * variable's value from the postmaster. But since we will, reset it when
2331  * MyProcPid changes. MyStartTime also changes when MyProcPid does, so
2332  * reset the formatted start timestamp too.
2333  */
2334  if (log_my_pid != MyProcPid)
2335  {
2336  log_line_number = 0;
2337  log_my_pid = MyProcPid;
2338  formatted_start_time[0] = '\0';
2339  }
2340  log_line_number++;
2341 
2342  if (Log_line_prefix == NULL)
2343  return; /* in case guc hasn't run yet */
2344 
2345  for (p = Log_line_prefix; *p != '\0'; p++)
2346  {
2347  if (*p != '%')
2348  {
2349  /* literal char, just copy */
2350  appendStringInfoChar(buf, *p);
2351  continue;
2352  }
2353 
2354  /* must be a '%', so skip to the next char */
2355  p++;
2356  if (*p == '\0')
2357  break; /* format error - ignore it */
2358  else if (*p == '%')
2359  {
2360  /* string contains %% */
2361  appendStringInfoChar(buf, '%');
2362  continue;
2363  }
2364 
2365 
2366  /*
2367  * Process any formatting which may exist after the '%'. Note that
2368  * process_log_prefix_padding moves p past the padding number if it
2369  * exists.
2370  *
2371  * Note: Since only '-', '0' to '9' are valid formatting characters we
2372  * can do a quick check here to pre-check for formatting. If the char
2373  * is not formatting then we can skip a useless function call.
2374  *
2375  * Further note: At least on some platforms, passing %*s rather than
2376  * %s to appendStringInfo() is substantially slower, so many of the
2377  * cases below avoid doing that unless non-zero padding is in fact
2378  * specified.
2379  */
2380  if (*p > '9')
2381  padding = 0;
2382  else if ((p = process_log_prefix_padding(p, &padding)) == NULL)
2383  break;
2384 
2385  /* process the option */
2386  switch (*p)
2387  {
2388  case 'a':
2389  if (MyProcPort)
2390  {
2391  const char *appname = application_name;
2392 
2393  if (appname == NULL || *appname == '\0')
2394  appname = _("[unknown]");
2395  if (padding != 0)
2396  appendStringInfo(buf, "%*s", padding, appname);
2397  else
2398  appendStringInfoString(buf, appname);
2399  }
2400  else if (padding != 0)
2402  padding > 0 ? padding : -padding);
2403 
2404  break;
2405  case 'u':
2406  if (MyProcPort)
2407  {
2408  const char *username = MyProcPort->user_name;
2409 
2410  if (username == NULL || *username == '\0')
2411  username = _("[unknown]");
2412  if (padding != 0)
2413  appendStringInfo(buf, "%*s", padding, username);
2414  else
2415  appendStringInfoString(buf, username);
2416  }
2417  else if (padding != 0)
2419  padding > 0 ? padding : -padding);
2420  break;
2421  case 'd':
2422  if (MyProcPort)
2423  {
2424  const char *dbname = MyProcPort->database_name;
2425 
2426  if (dbname == NULL || *dbname == '\0')
2427  dbname = _("[unknown]");
2428  if (padding != 0)
2429  appendStringInfo(buf, "%*s", padding, dbname);
2430  else
2431  appendStringInfoString(buf, dbname);
2432  }
2433  else if (padding != 0)
2435  padding > 0 ? padding : -padding);
2436  break;
2437  case 'c':
2438  if (padding != 0)
2439  {
2440  char strfbuf[128];
2441 
2442  snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x",
2443  (long) (MyStartTime), MyProcPid);
2444  appendStringInfo(buf, "%*s", padding, strfbuf);
2445  }
2446  else
2447  appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
2448  break;
2449  case 'p':
2450  if (padding != 0)
2451  appendStringInfo(buf, "%*d", padding, MyProcPid);
2452  else
2453  appendStringInfo(buf, "%d", MyProcPid);
2454  break;
2455  case 'l':
2456  if (padding != 0)
2457  appendStringInfo(buf, "%*ld", padding, log_line_number);
2458  else
2459  appendStringInfo(buf, "%ld", log_line_number);
2460  break;
2461  case 'm':
2463  if (padding != 0)
2464  appendStringInfo(buf, "%*s", padding, formatted_log_time);
2465  else
2467  break;
2468  case 't':
2469  {
2470  pg_time_t stamp_time = (pg_time_t) time(NULL);
2471  char strfbuf[128];
2472 
2473  pg_strftime(strfbuf, sizeof(strfbuf),
2474  "%Y-%m-%d %H:%M:%S %Z",
2475  pg_localtime(&stamp_time, log_timezone));
2476  if (padding != 0)
2477  appendStringInfo(buf, "%*s", padding, strfbuf);
2478  else
2479  appendStringInfoString(buf, strfbuf);
2480  }
2481  break;
2482  case 'n':
2483  {
2484  char strfbuf[128];
2485 
2486  if (!saved_timeval_set)
2487  {
2488  gettimeofday(&saved_timeval, NULL);
2489  saved_timeval_set = true;
2490  }
2491 
2492  snprintf(strfbuf, sizeof(strfbuf), "%ld.%03d",
2493  (long) saved_timeval.tv_sec,
2494  (int) (saved_timeval.tv_usec / 1000));
2495 
2496  if (padding != 0)
2497  appendStringInfo(buf, "%*s", padding, strfbuf);
2498  else
2499  appendStringInfoString(buf, strfbuf);
2500  }
2501  break;
2502  case 's':
2503  if (formatted_start_time[0] == '\0')
2505  if (padding != 0)
2506  appendStringInfo(buf, "%*s", padding, formatted_start_time);
2507  else
2509  break;
2510  case 'i':
2511  if (MyProcPort)
2512  {
2513  const char *psdisp;
2514  int displen;
2515 
2516  psdisp = get_ps_display(&displen);
2517  if (padding != 0)
2518  appendStringInfo(buf, "%*s", padding, psdisp);
2519  else
2520  appendBinaryStringInfo(buf, psdisp, displen);
2521 
2522  }
2523  else if (padding != 0)
2525  padding > 0 ? padding : -padding);
2526  break;
2527  case 'r':
2529  {
2530  if (padding != 0)
2531  {
2532  if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
2533  {
2534  /*
2535  * This option is slightly special as the port
2536  * number may be appended onto the end. Here we
2537  * need to build 1 string which contains the
2538  * remote_host and optionally the remote_port (if
2539  * set) so we can properly align the string.
2540  */
2541 
2542  char *hostport;
2543 
2544  hostport = psprintf("%s(%s)", MyProcPort->remote_host, MyProcPort->remote_port);
2545  appendStringInfo(buf, "%*s", padding, hostport);
2546  pfree(hostport);
2547  }
2548  else
2549  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2550  }
2551  else
2552  {
2553  /* padding is 0, so we don't need a temp buffer */
2555  if (MyProcPort->remote_port &&
2556  MyProcPort->remote_port[0] != '\0')
2557  appendStringInfo(buf, "(%s)",
2559  }
2560 
2561  }
2562  else if (padding != 0)
2564  padding > 0 ? padding : -padding);
2565  break;
2566  case 'h':
2568  {
2569  if (padding != 0)
2570  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2571  else
2573  }
2574  else if (padding != 0)
2576  padding > 0 ? padding : -padding);
2577  break;
2578  case 'q':
2579  /* in postmaster and friends, stop if %q is seen */
2580  /* in a backend, just ignore */
2581  if (MyProcPort == NULL)
2582  return;
2583  break;
2584  case 'v':
2585  /* keep VXID format in sync with lockfuncs.c */
2586  if (MyProc != NULL && MyProc->backendId != InvalidBackendId)
2587  {
2588  if (padding != 0)
2589  {
2590  char strfbuf[128];
2591 
2592  snprintf(strfbuf, sizeof(strfbuf) - 1, "%d/%u",
2594  appendStringInfo(buf, "%*s", padding, strfbuf);
2595  }
2596  else
2597  appendStringInfo(buf, "%d/%u", MyProc->backendId, MyProc->lxid);
2598  }
2599  else if (padding != 0)
2601  padding > 0 ? padding : -padding);
2602  break;
2603  case 'x':
2604  if (padding != 0)
2605  appendStringInfo(buf, "%*u", padding, GetTopTransactionIdIfAny());
2606  else
2608  break;
2609  case 'e':
2610  if (padding != 0)
2611  appendStringInfo(buf, "%*s", padding, unpack_sql_state(edata->sqlerrcode));
2612  else
2614  break;
2615  default:
2616  /* format error - ignore it */
2617  break;
2618  }
2619  }
2620 }
size_t pg_strftime(char *s, size_t max, const char *format, const struct pg_tm *tm)
Definition: strftime.c:122
int gettimeofday(struct timeval *tp, struct timezone *tzp)
Definition: gettimeofday.c:105
int MyProcPid
Definition: globals.c:39
int64 pg_time_t