PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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(), adjust_data_dir(), advice(), appendPsqlMetaConnect(), appendShellString(), associate(), ATWrongRelkindError(), auth_failed(), BaseBackup(), bootstrap_template1(), 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(), 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(), dbState(), DeadLockReport(), describeAccessMethods(), describeAggregates(), describeFunctions(), DescribeLockTag(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), 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(), exec_command_errverbose(), exec_command_ev(), exec_command_print(), exec_command_reset(), exec_command_s(), exec_command_timing(), exec_execute_message(), executeCommand(), executeQuery(), executeQueryOrDie(), exit_nicely(), 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(), 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_be_scram_init(), pg_fatal(), pg_get_keywords(), pg_log_v(), pg_malloc_internal(), pg_realloc(), pg_strdup(), pgbench_error(), pgfnames(), pgwin32_is_admin(), plain_crypt_verify(), plpgsql_exec_error_callback(), plpgsql_stmt_typename(), plpgsql_yyerror(), popen_check(), 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(), 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_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_postmaster_connection(), 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_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().

#define ERRORDATA_STACK_SIZE   5

Definition at line 138 of file elog.c.

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

#define EVALUATE_MESSAGE (   domain,
  targetfield,
  appendval,
  translateit 
)
#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().

#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

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

Definition at line 3652 of file elog.c.

References appendStringInfoCharMacro.

Referenced by send_message_to_server_log().

3653 {
3654  char ch;
3655 
3656  while ((ch = *str++) != '\0')
3657  {
3658  appendStringInfoCharMacro(buf, ch);
3659  if (ch == '\n')
3660  appendStringInfoCharMacro(buf, '\t');
3661  }
3662 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:135
static void appendCSVLiteral ( StringInfo  buf,
const char *  data 
)
inlinestatic

Definition at line 2623 of file elog.c.

References appendStringInfoCharMacro, and NULL.

Referenced by write_csvlog().

2624 {
2625  const char *p = data;
2626  char c;
2627 
2628  /* avoid confusing an empty string with NULL */
2629  if (p == NULL)
2630  return;
2631 
2632  appendStringInfoCharMacro(buf, '"');
2633  while ((c = *p++) != '\0')
2634  {
2635  if (c == '"')
2636  appendStringInfoCharMacro(buf, '"');
2637  appendStringInfoCharMacro(buf, c);
2638  }
2639  appendStringInfoCharMacro(buf, '"');
2640 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:135
char * c
#define NULL
Definition: c.h:229
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_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), 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:1077
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:675
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:849
char * constraint_name
Definition: elog.h:353
char * message
Definition: elog.h:343
void DebugFileOpen ( void  )

Definition at line 1863 of file elog.c.

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

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:61
bool IsUnderPostmaster
Definition: globals.c:100
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
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, NULL, 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:137
const char * message_id
Definition: elog.h:348
#define NULL
Definition: c.h:229
struct MemoryContextData * assoc_context
Definition: elog.h:360
const char * domain
Definition: elog.h:340
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, NULL, 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
#define NULL
Definition: c.h:229
void write_stderr(const char *fmt,...)
Definition: elog.c:3671
struct MemoryContextData * assoc_context
Definition: elog.h:360
static char * filename
Definition: pg_dumpall.c:87
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:2864
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:3147
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
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(), 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:
1210  set_errdata_field(edata->assoc_context, &edata->datatype_name, str);
1211  break;
1213  set_errdata_field(edata->assoc_context, &edata->constraint_name, str);
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
static const char * err_gettext ( const char *  str)
inlinestatic

Definition at line 208 of file elog.c.

References gettext, and in_error_recursion_trouble().

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:125
bool in_error_recursion_trouble(void)
Definition: elog.c:196
static void err_sendstring ( StringInfo  buf,
const char *  str 
)
static

Definition at line 3135 of file elog.c.

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

Referenced by send_message_to_frontend().

3136 {
3138  pq_send_ascii_string(buf, str);
3139  else
3140  pq_sendstring(buf, str);
3141 }
void pq_sendstring(StringInfo buf, const char *str)
Definition: pqformat.c:186
void pq_send_ascii_string(StringInfo buf, const char *str)
Definition: pqformat.c:218
bool in_error_recursion_trouble(void)
Definition: elog.c:196
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(), AllocSetContextCreate(), 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(), 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(), AuxiliaryProcessMain(), b64_decode(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFile(), be_lo_close(), be_lo_export(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), before_shmem_exit(), 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(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_agglevels_and_constraints(), check_circularity(), check_conn_params(), 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_safe_enum_use(), 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(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), CheckTransactionChain(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), chkpass_eq(), chkpass_in(), chkpass_ne(), 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_singleton_array(), 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(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_create(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumpbatch(), 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(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInsert(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteTruncate(), ExecWindowAgg(), ExecWithCheckOptions(), ExitPostmaster(), exp_var(), expand_col_privileges(), ExpandAllTables(), ExpandColumnRefStar(), ExplainQuery(), ExportSnapshot(), exprType(), ExtractExtensionList(), 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(), float4div(), float4in(), float84div(), 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(), 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_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_partition_for_tuple(), get_publication_oid(), get_range_io_data(), get_raw_page_internal(), get_relation_by_qualified_name(), 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_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_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), 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(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), 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_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_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_array(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_array(), 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(), LargeObjectDrop(), lastval(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_exec(), 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_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_internal(), lookup_type_cache(), LookupAggWithArgs(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), 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(), OpenTransientFile(), 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(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFile(), percentile_cont_final_common(), percentile_disc_final(), perform_default_encoding_conversion(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), 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_location(), pg_current_wal_insert_location(), pg_current_wal_location(), 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_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_report_error(), pgfdw_subxact_callback(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), 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(), 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(), 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(), PLyObject_ToDatum(), PLySequence_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(), 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(), 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_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_FKey_setdefault_del(), RI_FKey_setdefault_upd(), RI_FKey_setnull_del(), RI_FKey_setnull_upd(), RI_Initial_Check(), ri_ReportViolation(), ri_restrict_del(), ri_restrict_upd(), RollbackToSavepoint(), rpad(), SanityCheckBackgroundWorker(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), scram_build_verifier(), 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(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), similar_escape(), SnapBuildInitialSnapshot(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgvalidate(), SPI_cursor_open_internal(), 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(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), 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(), 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(), 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(), 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
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(), AddToDataDirLockFile(), AlterSystemSetConfigFile(), ApplyLogicalMappingFile(), assign_xlog_sync_method(), be_lo_export(), be_tls_init(), BeginCopyFrom(), BeginCopyTo(), BootStrapXLOG(), calculate_database_size(), calculate_relation_size(), calculate_tablespace_size(), CancelBackup(), ChangeToDataDir(), checkDataDir(), CheckForStandbyTrigger(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckXLogRemoved(), CleanupBackupHistory(), ClosePipeToProgram(), ClosePostmasterPorts(), copy_file(), copydir(), CopyGetData(), CopySendEndOfRow(), create_tablespace_directories(), CreateLockFile(), CreateSlotOnDisk(), db_dir_size(), DebugFileOpen(), 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_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(), 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(), pgarch_readyXlog(), 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(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), RemoveTwoPhaseFile(), RemoveXlogFile(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), ReplicationSlotDropPtr(), RestoreArchivedFile(), RestoreSlotFromDisk(), SaveSlotToPath(), scan_directory_ci(), sendDir(), sendFile(), sendTablespace(), SendTimeLineHistory(), SlruReportIOError(), SnapBuildRestore(), SnapBuildSerialize(), StartupReorderBuffer(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupXLOG(), SyncDataDirectory(), SysLogger_Start(), TablespaceCreateDbspace(), tokenize_file(), tokenize_inc_file(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), update_metainfo_datafile(), UpdateControlFile(), ValidatePgVersion(), walkdir(), WalReceiverMain(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_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
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(), pgstat_init(), PgstatCollectorMain(), pq_getbyte_if_available(), pq_recvbuf(), ProcessStartupPacket(), ServerLoop(), StreamConnection(), StreamServerPort(), SysLogger_Start(), and SysLoggerMain().

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
#define ECONNRESET
Definition: win32.h:295
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
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
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(), AllocSetContextCreate(), 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_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(), 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(), ExecWithCheckOptions(), ExitPostmaster(), FetchDynamicTimeZone(), FloatExceptionHandler(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), generate_recursion_path(), generateClonedIndexStmt(), 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(), incompatible_module_error(), InitPgFdwOptions(), InitPostgres(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), json_lex_string(), lazy_cleanup_index(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), 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_do_encoding_conversion(), pg_newlocale_from_collation(), pg_size_bytes(), pgarch_archiveXlog(), PGSharedMemoryCreate(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_post_column_ref(), PLy_exec_function(), PLy_exec_trigger(), PLy_initialize(), PLyObject_ToDatum(), populate_array_check_dimension(), preprocess_grouping_sets(), ProcedureCreate(), process_owned_by(), px_THROW_ERROR(), qtext_load_file(), queryin(), quickdie(), range_parse(), range_parse_bound(), ReadControlFile(), record_in(), refresh_by_match_merge(), reindex_index(), 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(), SlruReportIOError(), SnapBuildEndTxn(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), StartReplication(), StartupXLOG(), SyncRepWaitForLSN(), tfuncInitialize(), transformAggregateCall(), transformDeclareCursorStmt(), transformIndexConstraint(), 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(), 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
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(), 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(), OnConflict_CheckForSerializationFailure(), pgfdw_report_error(), PLy_elog(), PLy_output(), PreCommit_CheckForSerializationFailure(), rewriteTargetView(), ShowUsage(), and SnapBuildFindSnapshot().

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
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
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
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(), RegisterBackgroundWorker(), SnapBuildFindSnapshot(), 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
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, NULL, 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:34
#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:35
void proc_exit(int code)
Definition: ipc.c:99
static int recursion_depth
Definition: elog.c:144
char * internalquery
Definition: elog.h:356
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:950
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:36
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:137
char * detail
Definition: elog.h:344
void EmitErrorReport(void)
Definition: elog.c:1446
char * column_name
Definition: elog.h:351
#define NULL
Definition: c.h:229
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
void(* callback)(void *arg)
Definition: elog.h:239
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:97
CommandDest whereToSendOutput
Definition: postgres.c:86
char * constraint_name
Definition: elog.h:353
char * message
Definition: elog.h:343
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
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
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
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(), AlterSubscriptionOwner_internal(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), analyzeCTE(), assign_collations_walker(), assign_hypothetical_collations(), asyncQueueFillWarning(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecChangeOwner(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecSetRelOptions(), ATPrepAlterColumnType(), ATPrepDropNotNull(), ATPrepSetNotNull(), autovac_init(), b64_decode(), be_lo_export(), 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(), check_enable_rls(), check_lateral_ref_ok(), check_publication_add_relation(), check_safe_enum_use(), 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(), 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(), like_fixed_prefix(), lo_import_internal(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LogChildExit(), logicalrep_typmap_getid(), logicalrep_worker_launch(), LookupFuncName(), macaddr8tomacaddr(), make_row_comparison_op(), MarkAsPreparing(), 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_location(), pg_current_wal_insert_location(), pg_current_wal_location(), 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(), PLy_output(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyObject_ToDatum(), policy_role_list_to_array(), populate_array_report_expected_array(), populate_record_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_ReportViolation(), 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(), transformInsertRow(), transformOnConflictArbiter(), transformRangeFunction(), transformSetOperationStmt(), transformWindowDefinitions(), vacuum_set_xid_limits(), ValidatePgVersion(), varstr_cmp(), varstr_sortsupport(), VirtualXactLock(), and worker_spi_launch().

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
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(), _SPI_execute_plan(), _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(), AllocSetContextCreate(), 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(), 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(), autovac_init(), AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMain(), b64_decode(), backend_read_statsfile(), BackendInitialize(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFile(), be_lo_close(), be_lo_export(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), 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(), 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_database_size(), 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(), changeDependencyFor(), ChangeToDataDir(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_circularity(), check_conn_params(), 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_safe_enum_use(), 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(), CheckArchiveTimeout(), 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(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), checkTimeLineSwitch(), CheckTransactionChain(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), CheckXLogRemoved(), chkpass_eq(), chkpass_in(), chkpass_ne(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), cleanup_tsquery_stopwords(), CleanupBackupHistory(), 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_singleton_array(), 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(), 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(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_cleanup_for_mmap(), dsm_create(), 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(), dumpbatch(), 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(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInsert(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteRecoveryCommand(), ExecuteTruncate(), ExecWindowAgg(), ExecWithCheckOptions(), existsTimeLineHistory(), exitArchiveRecovery(), exp_var(), expand_col_privileges(), ExpandAllTables(), ExpandColumnRefStar(), explain_ExecutorEnd(), ExplainQuery(), ExportSnapshot(), exprType(), ExtractExtensionList(), 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(), FileClose(), 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(), float4div(), float4in(), float84div(), 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(), Generic_Text_IC_like(), get_am_type_oid(), get_cast_oid(), 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_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_partition_for_tuple(), get_publication_oid(), get_range_io_data(), get_raw_page(), get_raw_page_internal(), get_relation_by_qualified_name(), 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_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_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), 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(), 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_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_seek(), inv_write(), iso8859_to_utf8(), issue_xlog_fsync(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_array(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_array(), 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(), KeepFileRestoredFromArchive(), LargeObjectDrop(), lastval(), lazy_cleanup_index(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), 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_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_internal(), lookup_type_cache(), LookupAggWithArgs(), LookupFuncName(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), 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(), 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(), 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(), OpenTransientFile(), 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(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFile(), 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_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_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_location(), pg_current_wal_insert_location(), pg_current_wal_location(), 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_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_readyXlog(), pgarch_start(), pgfdw_report_error(), pgfdw_subxact_callback(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), 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(), 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(), PLyObject_ToDatum(), PLySequence_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(), 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(), 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(), RelationCacheInitFilePreInvalidate(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), reltime_interval(), remove_dbtablespaces(), remove_tablespace_symlink(), RemoveAccessMethodById(), RemoveExtensionById(), RemoveInheritance(), RemoveNonParentXlogFiles(), RemoveObjects(), RemoveOldXlogFiles(), 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_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(), RequestCheckpoint(), requireSuperuser(), reread_subscription(), rescanLatestTimeLine(), reserveAllocatedDesc(), 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_FKey_setdefault_del(), RI_FKey_setdefault_upd(), RI_FKey_setnull_del(), RI_FKey_setnull_upd(), RI_Initial_Check(), ri_ReportViolation(), ri_restrict_del(), ri_restrict_upd(), RollbackToSavepoint(), rpad(), SanityCheckBackgroundWorker(), SaveSlotToPath(), scan_directory_ci(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), scram_build_verifier(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_perl_context(), SendBaseBackup(), 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(), 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(), SlruDeleteSegment(), SlruInternalDeleteSegment(), SlruPhysicalReadPage(), SlruReportIOError(), SnapBuildEndTxn(), SnapBuildFindSnapshot(), SnapBuildInitialSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgvalidate(), SPI_cursor_open_internal(), 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_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(), 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(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), 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(), 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(), 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(), ValidateJoinEstimator(), 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(), 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(), 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(), 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
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(), 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(), 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(), PLy_output(), pmdie(), PostmasterMain(), processCancelRequest(), ReadRecord(), readRecoveryCommandFile(), reaper(), RegisterWaitForSingleObject(), reportDependentObjects(), RestoreArchivedFile(), ReThrowError(), setitimer(), ShowTransactionStateRec(), ShowUsage(), SignalSomeChildren(), SnapBuildFindSnapshot(), StartupXLOG(), tmp_dh_cb(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), WalRcvFetchTimeLineHistoryFiles(), and XLogWalRcvProcessMsg().

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
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(), func_select_candidate(), GetNewMultiXactId(), init_sexpr(), LookupAggWithArgs(), 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
static const char * error_severity ( int  elevel)
static

Definition at line 3601 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().

3602 {
3603  const char *prefix;
3604 
3605  switch (elevel)
3606  {
3607  case DEBUG1:
3608  case DEBUG2:
3609  case DEBUG3:
3610  case DEBUG4:
3611  case DEBUG5:
3612  prefix = gettext_noop("DEBUG");
3613  break;
3614  case LOG:
3615  case LOG_SERVER_ONLY:
3616  prefix = gettext_noop("LOG");
3617  break;
3618  case INFO:
3619  prefix = gettext_noop("INFO");
3620  break;
3621  case NOTICE:
3622  prefix = gettext_noop("NOTICE");
3623  break;
3624  case WARNING:
3625  prefix = gettext_noop("WARNING");
3626  break;
3627  case ERROR:
3628  prefix = gettext_noop("ERROR");
3629  break;
3630  case FATAL:
3631  prefix = gettext_noop("FATAL");
3632  break;
3633  case PANIC:
3634  prefix = gettext_noop("PANIC");
3635  break;
3636  default:
3637  prefix = "???";
3638  break;
3639  }
3640 
3641  return prefix;
3642 }
#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:139
#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:137
#define NOTICE
Definition: elog.h:37
#define DEBUG5
Definition: elog.h:20
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
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, NULL, 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  {
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:857
#define INFO
Definition: elog.h:33
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:135
#define PANIC
Definition: elog.h:53
ErrorContextCallback * error_context_stack
Definition: elog.c:88
bool ClientAuthInProgress
Definition: postmaster.c:348
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:3717
#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:36
#define ereport(elevel, rest)
Definition: elog.h:122
#define WARNING
Definition: elog.h:40
const char * debug_query_string
Definition: postgres.c:83
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
int elevel
Definition: elog.h:331
static int elevel
Definition: vacuumlazy.c:137
bool ExitOnAnyError
Definition: globals.c:104
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1012
int log_min_messages
Definition: guc.c:455
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:800
#define NULL
Definition: c.h:229
void write_stderr(const char *fmt,...)
Definition: elog.c:3671
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:87
int i
int client_min_messages
Definition: guc.c:456
CommandDest whereToSendOutput
Definition: postgres.c:86
const char * domain
Definition: elog.h:340
bool output_to_client
Definition: elog.h:333
static char * expand_fmt_string ( const char *  fmt,
ErrorData edata 
)
static

Definition at line 3337 of file elog.c.

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

3338 {
3340  const char *cp;
3341 
3342  initStringInfo(&buf);
3343 
3344  for (cp = fmt; *cp; cp++)
3345  {
3346  if (cp[0] == '%' && cp[1] != '\0')
3347  {
3348  cp++;
3349  if (*cp == 'm')
3350  {
3351  /*
3352  * Replace %m by system error string. If there are any %'s in
3353  * the string, we'd better double them so that vsnprintf won't
3354  * misinterpret.
3355  */
3356  const char *cp2;
3357 
3358  cp2 = useful_strerror(edata->saved_errno);
3359  for (; *cp2; cp2++)
3360  {
3361  if (*cp2 == '%')
3362  appendStringInfoCharMacro(&buf, '%');
3363  appendStringInfoCharMacro(&buf, *cp2);
3364  }
3365  }
3366  else
3367  {
3368  /* copy % and next char --- this avoids trouble with %%m */
3369  appendStringInfoCharMacro(&buf, '%');
3370  appendStringInfoCharMacro(&buf, *cp);
3371  }
3372  }
3373  else
3374  appendStringInfoCharMacro(&buf, *cp);
3375  }
3376 
3377  return buf.data;
3378 }
static const char * useful_strerror(int errnum)
Definition: elog.c:3385
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:135
static char * buf
Definition: pg_test_fsync.c:66
int saved_errno
Definition: elog.h:357
void initStringInfo(StringInfo str)
Definition: stringinfo.c:65
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_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), pltcl_elog(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), PostgresMain(), WalWriterMain(), and xml_is_document().

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
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:857
#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:1012
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
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:950
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
static const char * get_errno_symbol ( int  errnum)
static

Definition at line 3426 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, EWOULDBLOCK, and NULL.

Referenced by useful_strerror().

3427 {
3428  switch (errnum)
3429  {
3430  case E2BIG:
3431  return "E2BIG";
3432  case EACCES:
3433  return "EACCES";
3434 #ifdef EADDRINUSE
3435  case EADDRINUSE:
3436  return "EADDRINUSE";
3437 #endif
3438 #ifdef EADDRNOTAVAIL
3439  case EADDRNOTAVAIL:
3440  return "EADDRNOTAVAIL";
3441 #endif
3442  case EAFNOSUPPORT:
3443  return "EAFNOSUPPORT";
3444 #ifdef EAGAIN
3445  case EAGAIN:
3446  return "EAGAIN";
3447 #endif
3448 #ifdef EALREADY
3449  case EALREADY:
3450  return "EALREADY";
3451 #endif
3452  case EBADF:
3453  return "EBADF";
3454 #ifdef EBADMSG
3455  case EBADMSG:
3456  return "EBADMSG";
3457 #endif
3458  case EBUSY:
3459  return "EBUSY";
3460  case ECHILD:
3461  return "ECHILD";
3462 #ifdef ECONNABORTED
3463  case ECONNABORTED:
3464  return "ECONNABORTED";
3465 #endif
3466  case ECONNREFUSED:
3467  return "ECONNREFUSED";
3468 #ifdef ECONNRESET
3469  case ECONNRESET:
3470  return "ECONNRESET";
3471 #endif
3472  case EDEADLK:
3473  return "EDEADLK";
3474  case EDOM:
3475  return "EDOM";
3476  case EEXIST:
3477  return "EEXIST";
3478  case EFAULT:
3479  return "EFAULT";
3480  case EFBIG:
3481  return "EFBIG";
3482 #ifdef EHOSTUNREACH
3483  case EHOSTUNREACH:
3484  return "EHOSTUNREACH";
3485 #endif
3486  case EIDRM:
3487  return "EIDRM";
3488  case EINPROGRESS:
3489  return "EINPROGRESS";
3490  case EINTR:
3491  return "EINTR";
3492  case EINVAL:
3493  return "EINVAL";
3494  case EIO:
3495  return "EIO";
3496 #ifdef EISCONN
3497  case EISCONN:
3498  return "EISCONN";
3499 #endif
3500  case EISDIR:
3501  return "EISDIR";
3502 #ifdef ELOOP
3503  case ELOOP:
3504  return "ELOOP";
3505 #endif
3506  case EMFILE:
3507  return "EMFILE";
3508  case EMLINK:
3509  return "EMLINK";
3510  case EMSGSIZE:
3511  return "EMSGSIZE";
3512  case ENAMETOOLONG:
3513  return "ENAMETOOLONG";
3514  case ENFILE:
3515  return "ENFILE";
3516  case ENOBUFS:
3517  return "ENOBUFS";
3518  case ENODEV:
3519  return "ENODEV";
3520  case ENOENT:
3521  return "ENOENT";
3522  case ENOEXEC:
3523  return "ENOEXEC";
3524  case ENOMEM:
3525  return "ENOMEM";
3526  case ENOSPC:
3527  return "ENOSPC";
3528  case ENOSYS:
3529  return "ENOSYS";
3530 #ifdef ENOTCONN
3531  case ENOTCONN:
3532  return "ENOTCONN";
3533 #endif
3534  case ENOTDIR:
3535  return "ENOTDIR";
3536 #if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
3537  case ENOTEMPTY:
3538  return "ENOTEMPTY";
3539 #endif
3540 #ifdef ENOTSOCK
3541  case ENOTSOCK:
3542  return "ENOTSOCK";
3543 #endif
3544 #ifdef ENOTSUP
3545  case ENOTSUP:
3546  return "ENOTSUP";
3547 #endif
3548  case ENOTTY:
3549  return "ENOTTY";
3550  case ENXIO:
3551  return "ENXIO";
3552 #if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (EOPNOTSUPP != ENOTSUP))
3553  case EOPNOTSUPP:
3554  return "EOPNOTSUPP";
3555 #endif
3556 #ifdef EOVERFLOW
3557  case EOVERFLOW:
3558  return "EOVERFLOW";
3559 #endif
3560  case EPERM:
3561  return "EPERM";
3562  case EPIPE:
3563  return "EPIPE";
3564  case EPROTONOSUPPORT:
3565  return "EPROTONOSUPPORT";
3566  case ERANGE:
3567  return "ERANGE";
3568 #ifdef EROFS
3569  case EROFS:
3570  return "EROFS";
3571 #endif
3572  case ESRCH:
3573  return "ESRCH";
3574 #ifdef ETIMEDOUT
3575  case ETIMEDOUT:
3576  return "ETIMEDOUT";
3577 #endif
3578 #ifdef ETXTBSY
3579  case ETXTBSY:
3580  return "ETXTBSY";
3581 #endif
3582 #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
3583  case EWOULDBLOCK:
3584  return "EWOULDBLOCK";
3585 #endif
3586  case EXDEV:
3587  return "EXDEV";
3588  }
3589 
3590  return NULL;
3591 }
#define EWOULDBLOCK
Definition: win32.h:291
#define ENOTCONN
Definition: win32.h:317
#define EADDRINUSE
Definition: win32.h:311
#define EADDRNOTAVAIL
Definition: win32.h:313
#define ENOTSUP
Definition: private.h:35
#define ECONNREFUSED
Definition: win32.h:305
#define EINPROGRESS
Definition: win32.h:297
#define EOPNOTSUPP
Definition: win32.h:309
#define ECONNRESET
Definition: win32.h:295
#define EAGAIN
Definition: win32.h:283
#define EMSGSIZE
Definition: win32.h:287
#define EPROTONOSUPPORT
Definition: win32.h:303
#define EHOSTUNREACH
Definition: win32.h:315
#define ENOTSOCK
Definition: win32.h:307
#define EAFNOSUPPORT
Definition: win32.h:289
#define EISCONN
Definition: win32.h:299
#define EINTR
Definition: win32.h:285
#define NULL
Definition: c.h:229
#define ECONNABORTED
Definition: win32.h:293
#define EIDRM
Definition: win32.h:115
#define EOVERFLOW
Definition: private.h:38
#define ENOBUFS
Definition: win32.h:301
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
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, NULL, 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:857
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
#define NULL
Definition: c.h:229
char * context
Definition: elog.h:347
struct MemoryContextData * assoc_context
Definition: elog.h:360
void(* callback)(void *arg)
Definition: elog.h:239
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
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
bool in_error_recursion_trouble ( void  )

Definition at line 196 of file elog.c.

References recursion_depth.

Referenced by err_gettext(), err_sendstring(), errstart(), 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
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(), 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
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(), NULL, and pfree().

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), plpgsql_scanner_errposition(), PLy_elog(), 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:950
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
#define NULL
Definition: c.h:229
struct MemoryContextData * assoc_context
Definition: elog.h:360
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1064
static bool is_log_level_output ( int  elevel,
int  log_min_level 
)
static

Definition at line 3717 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().

3718 {
3719  if (elevel == LOG || elevel == LOG_SERVER_ONLY)
3720  {
3721  if (log_min_level == LOG || log_min_level <= ERROR)
3722  return true;
3723  }
3724  else if (log_min_level == LOG)
3725  {
3726  /* elevel != LOG */
3727  if (elevel >= FATAL)
3728  return true;
3729  }
3730  /* Neither is LOG */
3731  else if (elevel >= log_min_level)
3732  return true;
3733 
3734  return false;
3735 }
#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:137
static void log_line_prefix ( StringInfo  buf,
ErrorData edata 
)
static

Definition at line 2313 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, NULL, 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().

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

Definition at line 1729 of file elog.c.

References Assert, client_min_messages, ClientAuthInProgress, DestRemote, ErrorData::elevel, errfinish(), ERROR, errordata_stack_depth, ExceptionalCondition(), FATAL, is_log_level_output(), IsPostmasterEnvironment, log_min_messages, NULL, ErrorData::output_to_client, ErrorData::output_to_server, PG_exception_stack, and whereToSendOutput.

1730 {
1731  /* If possible, throw the error to the next outer setjmp handler */
1732  if (PG_exception_stack != NULL)
1733  siglongjmp(*PG_exception_stack, 1);
1734  else
1735  {
1736  /*
1737  * If we get here, elog(ERROR) was thrown inside a PG_TRY block, which
1738  * we have now exited only to discover that there is no outer setjmp
1739  * handler to pass the error to. Had the error been thrown outside
1740  * the block to begin with, we'd have promoted the error to FATAL, so
1741  * the correct behavior is to make it FATAL now; that is, emit it and
1742  * then call proc_exit.