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

Go to the source code of this file.

Macros

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

Functions

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

Variables

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

Macro Definition Documentation

◆ _

#define _ (   x)    err_gettext(x)

Definition at line 84 of file elog.c.

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

◆ CHECK_STACK_DEPTH

◆ ERRORDATA_STACK_SIZE

#define ERRORDATA_STACK_SIZE   5

Definition at line 138 of file elog.c.

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

◆ EVALUATE_MESSAGE

#define EVALUATE_MESSAGE (   domain,
  targetfield,
  appendval,
  translateit 
)
Value:
{ \
StringInfoData buf; \
/* Internationalize the error format string */ \
if ((translateit) && !in_error_recursion_trouble()) \
fmt = dgettext((domain), fmt); \
initStringInfo(&buf); \
if ((appendval) && edata->targetfield) { \
appendStringInfoString(&buf, edata->targetfield); \
appendStringInfoChar(&buf, '\n'); \
} \
/* Generate actual output --- have to use appendStringInfoVA */ \
for (;;) \
{ \
va_list args; \
int needed; \
errno = edata->saved_errno; \
va_start(args, fmt); \
needed = appendStringInfoVA(&buf, fmt, args); \
va_end(args); \
if (needed == 0) \
break; \
enlargeStringInfo(&buf, needed); \
} \
/* Save the completed message into the stack item */ \
if (edata->targetfield) \
pfree(edata->targetfield); \
edata->targetfield = pstrdup(buf.data); \
pfree(buf.data); \
}
char * pstrdup(const char *in)
Definition: mcxt.c:1161
static char * buf
Definition: pg_test_fsync.c:67
#define dgettext(d, x)
Definition: c.h:1088
bool in_error_recursion_trouble(void)
Definition: elog.c:193
int appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
Definition: stringinfo.c:120

Definition at line 705 of file elog.c.

Referenced by elog_finish(), errcontext_msg(), errdetail(), errdetail_internal(), errdetail_log(), errhint(), errmsg(), errmsg_internal(), and format_elog_string().

◆ EVALUATE_MESSAGE_PLURAL

#define EVALUATE_MESSAGE_PLURAL (   domain,
  targetfield,
  appendval 
)

Definition at line 741 of file elog.c.

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

◆ FORMATTED_TS_LEN

#define FORMATTED_TS_LEN   128

Definition at line 153 of file elog.c.

Referenced by setup_formatted_log_time(), and setup_formatted_start_time().

Function Documentation

◆ append_with_tabs()

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

Definition at line 3380 of file elog.c.

References appendStringInfoCharMacro.

Referenced by send_message_to_server_log().

3381 {
3382  char ch;
3383 
3384  while ((ch = *str++) != '\0')
3385  {
3386  appendStringInfoCharMacro(buf, ch);
3387  if (ch == '\n')
3388  appendStringInfoCharMacro(buf, '\t');
3389  }
3390 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:127

◆ appendCSVLiteral()

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

Definition at line 2617 of file elog.c.

References appendStringInfoCharMacro.

Referenced by write_csvlog().

2618 {
2619  const char *p = data;
2620  char c;
2621 
2622  /* avoid confusing an empty string with NULL */
2623  if (p == NULL)
2624  return;
2625 
2626  appendStringInfoCharMacro(buf, '"');
2627  while ((c = *p++) != '\0')
2628  {
2629  if (c == '"')
2630  appendStringInfoCharMacro(buf, '"');
2631  appendStringInfoCharMacro(buf, c);
2632  }
2633  appendStringInfoCharMacro(buf, '"');
2634 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:127
char * c

◆ CopyErrorData()

ErrorData* CopyErrorData ( void  )

Definition at line 1486 of file elog.c.

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

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

1487 {
1489  ErrorData *newedata;
1490 
1491  /*
1492  * we don't increment recursion_depth because out-of-memory here does not
1493  * indicate a problem within the error subsystem.
1494  */
1496 
1498 
1499  /* Copy the struct itself */
1500  newedata = (ErrorData *) palloc(sizeof(ErrorData));
1501  memcpy(newedata, edata, sizeof(ErrorData));
1502 
1503  /* Make copies of separately-allocated fields */
1504  if (newedata->message)
1505  newedata->message = pstrdup(newedata->message);
1506  if (newedata->detail)
1507  newedata->detail = pstrdup(newedata->detail);
1508  if (newedata->detail_log)
1509  newedata->detail_log = pstrdup(newedata->detail_log);
1510  if (newedata->hint)
1511  newedata->hint = pstrdup(newedata->hint);
1512  if (newedata->context)
1513  newedata->context = pstrdup(newedata->context);
1514  if (newedata->schema_name)
1515  newedata->schema_name = pstrdup(newedata->schema_name);
1516  if (newedata->table_name)
1517  newedata->table_name = pstrdup(newedata->table_name);
1518  if (newedata->column_name)
1519  newedata->column_name = pstrdup(newedata->column_name);
1520  if (newedata->datatype_name)
1521  newedata->datatype_name = pstrdup(newedata->datatype_name);
1522  if (newedata->constraint_name)
1523  newedata->constraint_name = pstrdup(newedata->constraint_name);
1524  if (newedata->internalquery)
1525  newedata->internalquery = pstrdup(newedata->internalquery);
1526 
1527  /* Use the calling context for string allocation */
1528  newedata->assoc_context = CurrentMemoryContext;
1529 
1530  return newedata;
1531 }
char * schema_name
Definition: elog.h:364
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
MemoryContext ErrorContext
Definition: mcxt.c:45
char * pstrdup(const char *in)
Definition: mcxt.c:1161
char * internalquery
Definition: elog.h:371
static int errordata_stack_depth
Definition: elog.c:142
char * detail_log
Definition: elog.h:360
char * table_name
Definition: elog.h:365
MemoryContext CurrentMemoryContext
Definition: mcxt.c:38
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
char * datatype_name
Definition: elog.h:367
char * detail
Definition: elog.h:359
char * column_name
Definition: elog.h:366
#define Assert(condition)
Definition: c.h:732
char * hint
Definition: elog.h:361
char * context
Definition: elog.h:362
struct MemoryContextData * assoc_context
Definition: elog.h:375
void * palloc(Size size)
Definition: mcxt.c:924
char * constraint_name
Definition: elog.h:368
char * message
Definition: elog.h:358

◆ DebugFileOpen()

void DebugFileOpen ( void  )

Definition at line 1852 of file elog.c.

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

Referenced by BaseInit().

1853 {
1854  int fd,
1855  istty;
1856 
1857  if (OutputFileName[0])
1858  {
1859  /*
1860  * A debug-output file name was given.
1861  *
1862  * Make sure we can write the file, and find out if it's a tty.
1863  */
1864  if ((fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY,
1865  0666)) < 0)
1866  ereport(FATAL,
1868  errmsg("could not open file \"%s\": %m", OutputFileName)));
1869  istty = isatty(fd);
1870  close(fd);
1871 
1872  /*
1873  * Redirect our stderr to the debug output file.
1874  */
1875  if (!freopen(OutputFileName, "a", stderr))
1876  ereport(FATAL,
1878  errmsg("could not reopen file \"%s\" as stderr: %m",
1879  OutputFileName)));
1880 
1881  /*
1882  * If the file is a tty and we're running under the postmaster, try to
1883  * send stdout there as well (if it isn't a tty then stderr will block
1884  * out stdout, so we may as well let stdout go wherever it was going
1885  * before).
1886  */
1887  if (istty && IsUnderPostmaster)
1888  if (!freopen(OutputFileName, "a", stdout))
1889  ereport(FATAL,
1891  errmsg("could not reopen file \"%s\" as stdout: %m",
1892  OutputFileName)));
1893  }
1894 }
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:69
bool IsUnderPostmaster
Definition: globals.c:108
int errcode_for_file_access(void)
Definition: elog.c:595
#define ereport(elevel, rest)
Definition: elog.h:141
int errmsg(const char *fmt,...)
Definition: elog.c:786
#define close(a)
Definition: win32.h:12

◆ elog_finish()

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

Definition at line 1337 of file elog.c.

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

1338 {
1340  MemoryContext oldcontext;
1341 
1343 
1344  /*
1345  * Do errstart() to see if we actually want to report the message.
1346  */
1348  errno = edata->saved_errno;
1349  if (!errstart(elevel, edata->filename, edata->lineno, edata->funcname, NULL))
1350  return; /* nothing to do */
1351 
1352  /*
1353  * Format error message just like errmsg_internal().
1354  */
1355  recursion_depth++;
1356  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1357 
1358  edata->message_id = fmt;
1359  EVALUATE_MESSAGE(edata->domain, message, false, false);
1360 
1361  MemoryContextSwitchTo(oldcontext);
1362  recursion_depth--;
1363 
1364  /*
1365  * And let errfinish() finish up.
1366  */
1367  errfinish(0);
1368 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
const char * funcname
Definition: elog.h:354
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
int lineno
Definition: elog.h:353
static int recursion_depth
Definition: elog.c:144
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:705
bool errstart(int elevel, const char *filename, int lineno, const char *funcname, const char *domain)
Definition: elog.c:230
void errfinish(int dummy,...)
Definition: elog.c:410
static int errordata_stack_depth
Definition: elog.c:142
const char * filename
Definition: elog.h:352
int saved_errno
Definition: elog.h:372
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
static int elevel
Definition: vacuumlazy.c:144
const char * message_id
Definition: elog.h:363
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ elog_start()

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

Definition at line 1287 of file elog.c.

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

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

◆ EmitErrorReport()

void EmitErrorReport ( void  )

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

1436 {
1438  MemoryContext oldcontext;
1439 
1440  recursion_depth++;
1442  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1443 
1444  /*
1445  * Call hook before sending message to log. The hook function is allowed
1446  * to turn off edata->output_to_server, so we must recheck that afterward.
1447  * Making any other change in the content of edata is not considered
1448  * supported.
1449  *
1450  * Note: the reason why the hook can only turn off output_to_server, and
1451  * not turn it on, is that it'd be unreliable: we will never get here at
1452  * all if errstart() deems the message uninteresting. A hook that could
1453  * make decisions in that direction would have to hook into errstart(),
1454  * where it would have much less information available. emit_log_hook is
1455  * intended for custom log filtering and custom log message transmission
1456  * mechanisms.
1457  *
1458  * The log hook has access to both the translated and original English
1459  * error message text, which is passed through to allow it to be used as a
1460  * message identifier. Note that the original text is not available for
1461  * detail, detail_log, hint and context text elements.
1462  */
1463  if (edata->output_to_server && emit_log_hook)
1464  (*emit_log_hook) (edata);
1465 
1466  /* Send to server log, if enabled */
1467  if (edata->output_to_server)
1469 
1470  /* Send to client, if enabled */
1471  if (edata->output_to_client)
1472  send_message_to_frontend(edata);
1473 
1474  MemoryContextSwitchTo(oldcontext);
1475  recursion_depth--;
1476 }
#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:2858
static int errordata_stack_depth
Definition: elog.c:142
bool output_to_server
Definition: elog.h:347
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
static void send_message_to_frontend(ErrorData *edata)
Definition: elog.c:3141
struct MemoryContextData * assoc_context
Definition: elog.h:375
emit_log_hook_type emit_log_hook
Definition: elog.c:101
bool output_to_client
Definition: elog.h:348

◆ err_generic_string()

int err_generic_string ( int  field,
const char *  str 
)

Definition at line 1180 of file elog.c.

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

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

1181 {
1183 
1184  /* we don't bother incrementing recursion_depth */
1186 
1187  switch (field)
1188  {
1189  case PG_DIAG_SCHEMA_NAME:
1190  set_errdata_field(edata->assoc_context, &edata->schema_name, str);
1191  break;
1192  case PG_DIAG_TABLE_NAME:
1193  set_errdata_field(edata->assoc_context, &edata->table_name, str);
1194  break;
1195  case PG_DIAG_COLUMN_NAME:
1196  set_errdata_field(edata->assoc_context, &edata->column_name, str);
1197  break;
1198  case PG_DIAG_DATATYPE_NAME:
1200  break;
1203  break;
1204  default:
1205  elog(ERROR, "unsupported ErrorData field id: %d", field);
1206  break;
1207  }
1208 
1209  return 0; /* return value does not matter */
1210 }
char * schema_name
Definition: elog.h:364
#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:365
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
char * datatype_name
Definition: elog.h:367
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str)
Definition: elog.c:1216
#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:366
struct MemoryContextData * assoc_context
Definition: elog.h:375
#define elog(elevel,...)
Definition: elog.h:226
char * constraint_name
Definition: elog.h:368

◆ err_gettext()

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

Definition at line 205 of file elog.c.

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

206 {
207 #ifdef ENABLE_NLS
209  return str;
210  else
211  return gettext(str);
212 #else
213  return str;
214 #endif
215 }
#define gettext(x)
Definition: c.h:1087
bool in_error_recursion_trouble(void)
Definition: elog.c:193

◆ err_sendstring()

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

Definition at line 3129 of file elog.c.

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

Referenced by send_message_to_frontend().

3130 {
3132  pq_send_ascii_string(buf, str);
3133  else
3134  pq_sendstring(buf, str);
3135 }
void pq_sendstring(StringInfo buf, const char *str)
Definition: pqformat.c:197
void pq_send_ascii_string(StringInfo buf, const char *str)
Definition: pqformat.c:229
bool in_error_recursion_trouble(void)
Definition: elog.c:193

◆ errcode()

int errcode ( int  sqlerrcode)

Definition at line 572 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(), 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(), AllocSetContextCreateInternal(), 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(), analyzeCTE(), analyzeCTETargetList(), anyarray_in(), anyarray_recv(), anybit_typmodin(), anychar_typmodin(), anyenum_in(), anyrange_in(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_origin(), apply_typmod(), apw_start_database_worker(), apw_start_master_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), array_fill(), array_fill_internal(), array_fill_with_lower_bounds(), array_get_slice(), array_in(), array_iterator(), array_map(), array_position_common(), array_positions(), array_prepend(), array_recv(), array_replace_internal(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assign_record_type_identifier(), assignOperTypes(), assignProcTypes(), AssignTypeArrayOid(), Async_Notify(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepDropColumn(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetStatistics(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), ATWrongRelkindError(), auth_failed(), autoinc(), autoprewarm_database_main(), autoprewarm_start_worker(), AuxiliaryProcessMain(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFilePerm(), be_lo_close(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), before_shmem_exit(), BeginCopy(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), BootStrapXLOG(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brinGetTupleForHeapBlock(), brininsert(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_check(), bt_downlink_missing_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(), bt_tuple_present_callback(), btree_index_checkable(), btvalidate(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), 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(), cannotCastJsonbValue(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), changeDependencyFor(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_agglevels_and_constraints(), check_circularity(), check_conn_params(), check_default_partition_contents(), check_default_tablespace(), check_enable_rls(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_float4_val(), check_float8_val(), 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_sql_fn_statements(), check_srf_call_placement(), check_ssl_key_file_permissions(), check_stack_depth(), check_strxfrm_bug(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPredicate(), CheckRecoveryConflictDeadlock(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), CheckTransactionBlock(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), ClientAuthentication(), close_lb(), close_sl(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), colNameToVar(), CommandCounterIncrement(), CommentObject(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_common_attribute(), compute_function_attributes(), 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_ordinary_grouping_paths(), create_proc_lang(), create_tablespace_directories(), create_toast_table(), CreateAccessMethod(), CreateCast(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_coord(), cube_coord_llur(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dasin(), dasind(), date2timestamp(), date2timestamptz(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_encoding_convert(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_connect(), dblink_connstr_check(), dblink_exec(), dblink_fdw_validator(), dblink_fetch(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DCH_from_char(), DCH_to_char(), dcos(), dcosd(), dcot(), dcotd(), DeadLockReport(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), defGetString(), defGetStringList(), defGetTypeLength(), defGetTypeName(), define_custom_variable(), DefineAggregate(), DefineCollation(), DefineCompositeType(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineSavepoint(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DefineType(), DefineView(), DefineVirtualRelation(), deflist_to_tuplestore(), deleteConnection(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_to_timestamp(), DoCopy(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_create(), dsm_impl_sysv(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker(), each_worker_jsonb(), ean2isn(), ean2string(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EnableLockPagesPrivilege(), 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_move_row_from_fields(), exec_object_restorecon(), exec_parse_message(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_call(), exec_stmt_case(), exec_stmt_close(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecCallTriggerFunc(), ExecCheckHeapTupleVisible(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecConstraints(), ExecCreateTableAs(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalArrayRefSubscript(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecInitAgg(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheckEmitError(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteCallStmt(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteTruncate(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), ExitPostmaster(), exp_var(), expand_col_privileges(), expand_vacuum_rel(), ExpandAllTables(), ExpandColumnRefStar(), ExplainQuery(), ExportSnapshot(), exprType(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fatal_llvm_error_handler(), fatal_system_new_handler(), 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_my_exec(), 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(), float4_accum(), float4_div(), float4_numeric(), float4in(), float8_accum(), float8_div(), float8_numeric(), float8_regr_accum(), float8_timestamptz(), float8in_internal(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), forkname_to_number(), free_parsestate(), FreezeMultiXactId(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), fsm_page_contents(), ftoi2(), ftoi4(), ftoi8(), func_select_candidate(), g_cube_distance(), gbtreekey_in(), gbtreekey_out(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), get_am_type_oid(), get_cast_oid(), get_collation_oid(), get_connect_string(), get_controlfile(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_encoding_name_for_icu(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), get_namespace_oid(), get_object_address(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_publication_rel(), get_object_address_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page_internal(), get_relation_by_qualified_name(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_required_extension(), get_rewrite_oid(), get_role_oid(), get_rolespec_oid(), get_rolespec_tuple(), get_rte_attribute_is_dropped(), get_rte_attribute_type(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), get_tablespace_oid(), get_th(), get_transform_oid(), get_trigger_oid(), get_ts_config_oid(), get_ts_dict_oid(), get_ts_parser_func(), get_ts_parser_oid(), get_ts_template_func(), get_ts_template_oid(), get_tsearch_config_filename(), get_tuple_of_interest(), get_windowfunc_expr(), getAffixFlagSet(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), 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_query_standard(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginCombineData(), GinFormTuple(), ginNewScanKey(), ginvalidate(), gistcheckpage(), gistSplit(), gistUserPicksplit(), gistvalidate(), gistValidateBufferingOption(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleFunctionRequest(), HandleParallelMessages(), has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), hash_array(), hash_array_extended(), hash_array_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_scalar(), hash_search_with_hash_value(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_form_minimal_tuple(), heap_form_tuple(), heap_inplace_update(), heap_lock_tuple(), heap_open(), heap_openrv(), heap_openrv_extended(), heap_page_items(), heap_prepare_freeze_tuple(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_update(), hex2_to_uchar(), hex_decode(), hlparsetext(), HoldPinnedPortals(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), ident_inet(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), index_check_primary_key(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_open(), IndexBuildHeapRangeScan(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), init_sql_fcache(), initArrayResultArr(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), InitWalSenderSlot(), inner_subltree(), insert_username(), InsertRule(), instantiate_empty_record_variable(), int24div(), int24mi(), int24mul(), int24pl(), int28div(), int28mi(), int28mul(), int28pl(), int2_dist(), int2abs(), int2div(), int2mi(), int2mod(), int2mul(), int2pl(), int2um(), int2vectorin(), int2vectorrecv(), int42div(), int42mi(), int42mul(), int42pl(), int48div(), int48mi(), int48mul(), int48pl(), int4_dist(), int4abs(), int4div(), int4inc(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8inc(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_get_result_type(), internal_inetpl(), internal_load_library(), interpret_AS_clause(), interpret_func_parallel(), interpret_function_parameter_list(), interpretOidsOption(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_set(), JsonEncodeDateTime(), JsValueToJsObject(), LargeObjectDrop(), lastval(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_exec(), like_fixed_prefix(), line_construct_pp(), line_in(), line_recv(), ln_var(), lo_get_fragment_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_libraries(), load_relmap_file(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), LockViewRecurse_walker(), logicalrep_rel_open(), logicalrep_worker_attach(), logicalrep_worker_launch(), lookup_agg_function(), lookup_fdw_handler_func(), lookup_index_am_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), ltree_to_plpython(), ltxtq_out(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), make_absolute_path(), make_date(), make_distinct_op(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), 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(), mark_index_clustered(), MarkAsPreparing(), MarkPortalActive(), MatchText(), materializeResult(), md5_bytea(), md5_text(), mdextend(), mdread(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), movedb(), mul_size(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), NonFiniteTimestampTzPart(), NUM_processor(), NUMDesc_prepare(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4(), numeric_int8(), numeric_power(), numeric_recv(), numeric_to_double_no_overflow(), numerictypmodin(), numericvar_to_double_no_overflow(), numericvar_to_int32(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), on_proc_exit(), on_shmem_exit(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum(), page_header(), PageAddItemExtended(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_extension_control_file(), parse_fcall_arguments(), parse_fcall_arguments_20(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_jsonb_index_flags(), 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(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFilePerm(), pclose_check(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_base64_decode(), pg_be_scram_build_verifier(), pg_be_scram_exchange(), pg_be_scram_init(), pg_cancel_backend(), pg_char_to_encoding(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_ddl_command_in(), pg_ddl_command_out(), pg_ddl_command_recv(), pg_ddl_command_send(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_ownercheck(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_extension_update_paths(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_serial_sequence(), pg_hba_file_rules(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), pg_logdir_ls(), pg_logdir_ls_internal(), pg_logical_slot_get_changes_guts(), pg_ls_tmpdir(), 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_read_file_v2(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_replication_slot_advance(), pg_rotate_logfile(), 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_get_activity(), pg_stat_get_progress_info(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pg_stat_statements_reset(), pg_statistics_object_ownercheck(), pg_stop_backup(), pg_stop_backup_v2(), pg_strtoint16(), pg_strtoint32(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_visibility(), pg_visibility_map(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), pgrowlocks(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_init(), pgstat_relation(), pgstat_reset_shared_counters(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), placeChar(), plperl_array_to_datum(), plperl_build_tuple_result(), plperl_call_perl_event_trigger_func(), plperl_call_perl_func(), plperl_call_perl_trigger_func(), plperl_create_sub(), plperl_func_handler(), plperl_init_interp(), plperl_modify_tuple(), plperl_return_next_internal(), plperl_spi_execute_fetch_result(), plperl_sv_to_datum(), plperl_sv_to_literal(), plperl_to_hstore(), 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_param_eval_generic(), plpgsql_param_eval_generic_ro(), plpgsql_param_eval_recfield(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_resolve_polymorphic_argtypes(), plpgsql_validator(), plpgsql_yyerror(), plpython_to_hstore(), pltcl_build_tuple_result(), pltcl_elog(), pltcl_func_handler(), pltcl_trigger_handler(), PLy_cursor_fetch(), PLy_elog_impl(), PLy_exec_function(), PLy_exec_trigger(), PLy_function_build_args(), PLy_modify_tuple(), PLy_output(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLyObject_AsString(), PLyObject_ToJsonbValue(), PLySequence_ToComposite(), PLyString_ToComposite(), policy_role_list_to_array(), 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(), PreventInTransactionBlock(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_matched_tle(), process_owned_by(), process_postgres_switches(), ProcessCopyOptions(), ProcessGUCArray(), ProcessInterrupts(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), 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(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), raw_heap_insert(), RE_compile(), RE_compile_and_cache(), RE_wchar_execute(), read_any_attr(), read_attr_value(), read_backup_label(), read_binary_file(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_objtype_from_string(), read_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadBuffer_common(), ReadBufferExtended(), ReadControlFile(), readRecoveryCommandFile(), readstoplist(), ReadTwoPhaseFile(), 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(), refuseDupeIndexAttach(), 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(), reindex_relation(), ReindexMultipleTables(), ReindexPartitionedIndex(), RelationBuildPartitionKey(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), remove_tablespace_symlink(), RemoveAccessMethodById(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePolicyById(), RemoveRelations(), RemoveRoleFromObjectPolicy(), RemoveTriggerById(), RemoveUserMapping(), rename_constraint_internal(), rename_policy(), renameatt_check(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquire(), ReplicationSlotCreate(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_invalid_token(), report_name_conflict(), report_namespace_conflict(), report_parse_error(), report_untranslatable_char(), reportDependentObjects(), requireSuperuser(), reserveAllocatedDesc(), resolve_column_ref(), resolve_generic_type(), resolve_unique_index_expr(), ResolveOpClass(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), RI_FKey_fk_upd_check_required(), RI_FKey_pk_upd_check_required(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), ri_restrict(), ri_setdefault(), ri_setnull(), RollbackToSavepoint(), rpad(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_perl_context(), SendCopyBegin(), sendDir(), SendFunctionResult(), SendTimeLineHistory(), 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_pglocale_pgservice(), 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(), setup_regexp_matches(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), similar_escape(), SlabContextCreate(), SnapBuildInitialSnapshot(), SnapBuildRestore(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgGetCache(), spgvalidate(), SPI_commit(), SPI_cursor_open_internal(), SPI_rollback(), SPI_sql_row_to_xmlelement(), split_text(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutovacuumWorker(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupXLOG(), statext_dependencies_deserialize(), statext_ndistinct_deserialize(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_tolower(), str_toupper(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), substitute_libpath_macro(), suppress_redundant_updates_trigger(), SV_to_JsonbValue(), 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_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_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(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), tokenize_file(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformArrayExpr(), transformArraySubscripts(), transformArrayType(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFrameOffset(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), truncate_check_activity(), truncate_check_rel(), truncate_identifier(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_stat_sql(), tsquery_phrase_distance(), tsquery_rewrite_query(), tsvector_concat(), tsvector_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tuple_equals_slot(), tupledesc_match(), txid_snapshot_recv(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_dict(), unaccent_init(), unique_key_recheck(), unknown_attribute(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vacuum(), vacuum_open_relation(), validate_ddl_tags(), validate_index_heapscan(), validate_option_array_item(), validate_pkattnums(), validate_table_rewrite_tags(), validateCheckConstraint(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePgVersion(), ValidateRestrictionEstimator(), validateWithCheckOption(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_cmp(), varstr_levenshtein(), varstr_sortsupport(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToExit(), WaitForParallelWorkersToFinish(), 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(), XLogFileCopy(), XLogPageRead(), XLogRead(), XlogReadTwoPhaseData(), XLogWalRcvProcessMsg(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

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

◆ errcode_for_file_access()

int errcode_for_file_access ( void  )

Definition at line 595 of file elog.c.

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

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

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

◆ errcode_for_socket_access()

int errcode_for_socket_access ( void  )

Definition at line 666 of file elog.c.

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

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

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

◆ errcontext_msg()

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

Definition at line 1001 of file elog.c.

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

1002 {
1004  MemoryContext oldcontext;
1005 
1006  recursion_depth++;
1008  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1009 
1010  EVALUATE_MESSAGE(edata->context_domain, context, true, true);
1011 
1012  MemoryContextSwitchTo(oldcontext);
1013  recursion_depth--;
1014  return 0; /* return value does not matter */
1015 }
#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:705
const char * context_domain
Definition: elog.h:356
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:375

◆ errdetail()

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

Definition at line 862 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(), AllocSetContextCreateInternal(), AlterExtensionNamespace(), AlterPublicationTables(), AlterTableNamespace(), apply_typmod(), array_cat(), array_fill_internal(), array_in(), array_set_slice(), ArrayCount(), asyncQueueFillWarning(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddInherit(), ATExecAlterColumnType(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATPrepAlterColumnType(), ATPrepChangePersistence(), be_tls_init(), brin_page_type(), btree_index_checkable(), CancelBackup(), check_conn_params(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_lateral_ref_ok(), check_new_partition_bound(), check_primary_key(), check_publication_add_relation(), check_rolespec_name(), check_sql_fn_retval(), check_ssl_key_file_permissions(), 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_ordinary_grouping_paths(), createdb(), CreateDecodingContext(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateTableSpace(), CreateTrigger(), crosstab(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_subset(), dblink_connstr_check(), dblink_fdw_validator(), dblink_security_check(), DefineIndex(), DefineOpClass(), DropSubscription(), dsa_allocate_extended(), dshash_create(), EnableLockPagesPrivilege(), enforce_generic_type_consistency(), enlargeStringInfo(), EnumValuesCreate(), errdetail_abort(), errdetail_busy_db(), errdetail_execute(), errdetail_params(), errdetail_recovery_conflict(), EvaluateParams(), exec_move_row_from_fields(), exec_stmt_dynexecute(), exec_stmt_execsql(), ExecCheckPlanOutput(), ExecConstraints(), ExecEvalArrayExpr(), ExecEvalFieldSelect(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecPartitionCheckEmitError(), ExecUpdate(), ExecWithCheckOptions(), ExitPostmaster(), fatal_system_new_handler(), FetchDynamicTimeZone(), FloatExceptionHandler(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), generate_recursion_path(), generateClonedIndexStmt(), GenerationContextCreate(), get_connect_string(), get_crosstab_tuplestore(), get_page_from_raw(), getid(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), gin_leafpage_items(), gin_metapage_info(), gistbulkdelete(), gistdoinsert(), gistValidateBufferingOption(), heap_create(), heap_truncate_check_FKs(), hlparsetext(), ident_inet(), incompatible_module_error(), InitPgFdwOptions(), InitPostgres(), instantiate_empty_record_variable(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), json_lex_string(), lazy_cleanup_index(), lc_ctype_is_c(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), LogChildExit(), LogicalRepSyncTableStart(), lquery_in(), ltree_in(), ltxtq_out(), make_pathkeys_for_window(), make_row_comparison_op(), map_sql_value_to_xml_value(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), MergeAttributes(), namerecv(), network_in(), network_recv(), NUMDesc_prepare(), palloc(), palloc0(), palloc_extended(), parse_ident(), parse_one_reloption(), parserOpenTable(), parsetext(), perform_default_encoding_conversion(), pg_be_scram_exchange(), pg_do_encoding_conversion(), pg_newlocale_from_collation(), pg_size_bytes(), pgarch_archiveXlog(), pgrowlocks(), PGSharedMemoryCreate(), plpgsql_post_column_ref(), PLy_exec_function(), PLy_exec_trigger(), PLy_initialize(), PLySequence_ToArray_recurse(), PLyString_ToComposite(), populate_array_check_dimension(), preprocess_grouping_sets(), ProcedureCreate(), process_owned_by(), ProcessUtilitySlow(), px_THROW_ERROR(), qtext_load_file(), queryin(), quickdie(), range_parse(), range_parse_bound(), read_any_attr(), read_attr_value(), read_backup_label(), read_client_final_message(), read_client_first_message(), ReadControlFile(), record_in(), refresh_by_match_merge(), refuseDupeIndexAttach(), RenameEnumLabel(), RenameRole(), RenameSchema(), RenameTableSpace(), repalloc(), repalloc_huge(), report_invalid_token(), report_parse_error(), reportDependentObjects(), rewriteTargetListIU(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), set_max_safe_fds(), SetTransactionSnapshot(), SlabContextCreate(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), StartReplication(), StartupXLOG(), SyncRepWaitForLSN(), tfuncInitialize(), transformAggregateCall(), transformDeclareCursorStmt(), transformIndexConstraint(), transformPartitionBoundValue(), transformSetOperationStmt(), transformTableLikeClause(), tupledesc_match(), vac_truncate_clog(), validateConnectbyTupleDesc(), ValidatePgVersion(), validateWithCheckOption(), variable_coerce_param_hook(), verify_brin_page(), verify_hash_page(), verify_message(), WalReceiverMain(), write_relcache_init_file(), XlogReadTwoPhaseData(), xml_is_document(), xmlpi(), and xpath_table().

863 {
865  MemoryContext oldcontext;
866 
867  recursion_depth++;
869  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
870 
871  EVALUATE_MESSAGE(edata->domain, detail, false, true);
872 
873  MemoryContextSwitchTo(oldcontext);
874  recursion_depth--;
875  return 0; /* return value does not matter */
876 }
#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:705
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:375
const char * domain
Definition: elog.h:355

◆ errdetail_internal()

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

Definition at line 889 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_downlink_missing_check(), bt_right_page_check_scankey(), bt_target_page_check(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckSCRAMAuth(), ClosePipeToProgram(), connect_pg_server(), ConvertTriggerToFK(), dblink_connect(), dblink_get_conn(), dblink_res_error(), DeadLockReport(), DropRole(), elog_node_display(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), incompatible_module_error(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), OnConflict_CheckForSerializationFailure(), pgfdw_report_error(), PLy_elog_impl(), PLy_output(), PreCommit_CheckForSerializationFailure(), reindex_index(), rewriteTargetView(), run_ssl_passphrase_command(), ShowUsage(), SnapBuildFindSnapshot(), sts_parallel_scan_next(), sts_read_tuple(), and xml_is_document().

890 {
892  MemoryContext oldcontext;
893 
894  recursion_depth++;
896  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
897 
898  EVALUATE_MESSAGE(edata->domain, detail, false, false);
899 
900  MemoryContextSwitchTo(oldcontext);
901  recursion_depth--;
902  return 0; /* return value does not matter */
903 }
#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:705
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:375
const char * domain
Definition: elog.h:355

◆ errdetail_log()

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

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

911 {
913  MemoryContext oldcontext;
914 
915  recursion_depth++;
917  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
918 
919  EVALUATE_MESSAGE(edata->domain, detail_log, false, true);
920 
921  MemoryContextSwitchTo(oldcontext);
922  recursion_depth--;
923  return 0; /* return value does not matter */
924 }
#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:705
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:375
const char * domain
Definition: elog.h:355

◆ errdetail_log_plural()

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

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

933 {
935  MemoryContext oldcontext;
936 
937  recursion_depth++;
939  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
940 
941  EVALUATE_MESSAGE_PLURAL(edata->domain, detail_log, false);
942 
943  MemoryContextSwitchTo(oldcontext);
944  recursion_depth--;
945  return 0; /* return value does not matter */
946 }
#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:741
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ errdetail_plural()

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

Definition at line 954 of file elog.c.

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

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

956 {
958  MemoryContext oldcontext;
959 
960  recursion_depth++;
962  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
963 
964  EVALUATE_MESSAGE_PLURAL(edata->domain, detail, false);
965 
966  MemoryContextSwitchTo(oldcontext);
967  recursion_depth--;
968  return 0; /* return value does not matter */
969 }
#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:741
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ errfinish()

void errfinish ( int  dummy,
  ... 
)

Definition at line 410 of file elog.c.

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

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

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

◆ errfunction()

int errfunction ( const char *  funcname)

Definition at line 1097 of file elog.c.

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

1098 {
1100 
1101  /* we don't bother incrementing recursion_depth */
1103 
1104  edata->funcname = funcname;
1105  edata->show_funcname = true;
1106 
1107  return 0; /* return value does not matter */
1108 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
const char * funcname
Definition: elog.h:354
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:349

◆ errhidecontext()

int errhidecontext ( bool  hide_ctx)

Definition at line 1076 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_ctx.

Referenced by llvm_compile_module().

1077 {
1079 
1080  /* we don't bother incrementing recursion_depth */
1082 
1083  edata->hide_ctx = hide_ctx;
1084 
1085  return 0; /* return value does not matter */
1086 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
bool hide_ctx
Definition: elog.h:351
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errhidestmt()

int errhidestmt ( bool  hide_stmt)

Definition at line 1057 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(), explain_ExecutorEnd(), and llvm_compile_module().

1058 {
1060 
1061  /* we don't bother incrementing recursion_depth */
1063 
1064  edata->hide_stmt = hide_stmt;
1065 
1066  return 0; /* return value does not matter */
1067 }
bool hide_stmt
Definition: elog.h:350
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errhint()

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

Definition at line 976 of file elog.c.

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

Referenced by _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_pagedel(), _hash_checkpage(), _hash_doinsert(), aclparse(), addTargetToSortList(), AlterEventTriggerOwner_internal(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner_internal(), AlterPublicationOwner_internal(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), analyzeCTE(), apw_start_database_worker(), apw_start_master_worker(), assign_collations_walker(), assign_hypothetical_collations(), asyncQueueFillWarning(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecChangeOwner(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecSetRelOptions(), ATExecSetStatistics(), ATPrepAlterColumnType(), ATPrepDropNotNull(), ATPrepSetNotNull(), autovac_init(), BackendRun(), BeginCopyFrom(), BeginCopyTo(), brin_desummarize_range(), brin_summarize_range(), bt_target_page_check(), bt_tuple_present_callback(), build_column_default(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), char2wchar(), check_agg_arguments_walker(), check_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(), DropSubscription(), EnableLockPagesPrivilege(), error_commit_ts_disabled(), errorMissingColumn(), errorMissingRTE(), EvaluateParams(), exec_move_row_from_fields(), 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(), interpret_function_parameter_list(), intorel_startup(), IpcSemaphoreInitialize(), json_build_object(), jsonb_build_object(), like_fixed_prefix(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LogChildExit(), logicalrep_worker_launch(), LookupFuncName(), macaddr8tomacaddr(), make_row_comparison_op(), MarkAsPreparing(), MatchText(), mdextend(), mdwrite(), MergeAttributes(), movedb(), OnConflict_CheckForSerializationFailure(), op_error(), palloc_btree_page(), parse_and_validate_value(), parse_hba_line(), parse_jsonb_index_flags(), parse_sane_timezone(), ParseFuncOrColumn(), parserOpenTable(), pg_base64_decode(), pg_create_restore_point(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_is_wal_replay_paused(), pg_newlocale_from_collation(), pg_prewarm(), pg_read_file(), pg_rotate_logfile(), pg_set_regex_collation(), pg_size_bytes(), pg_stop_backup(), pg_stop_backup_v2(), pg_switch_wal(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_archiveXlog(), pgfdw_report_error(), PGSharedMemoryCreate(), pgstat_reset_shared_counters(), PLy_elog_impl(), PLy_output(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyString_ToComposite(), policy_role_list_to_array(), populate_array_report_expected_array(), populate_record_worker(), populate_recordset_worker(), PortalRunSelect(), postgres_fdw_validator(), postgresql_fdw_validator(), PostmasterMain(), PreCommit_CheckForSerializationFailure(), PrepareRedoAdd(), ProcedureCreate(), process_owned_by(), process_postgres_switches(), ProcessInterrupts(), ProcessStartupPacket(), px_THROW_ERROR(), quickdie(), range_parse_flags(), RangeVarCallbackForAlterRelation(), ReadBuffer_common(), ReadControlFile(), readRecoveryCommandFile(), readTimeLineHistory(), recoveryPausesHere(), recursive_revoke(), regexp_match(), RegisterBackgroundWorker(), regoperatorin(), ReleaseOneSerializableXact(), RemoveObjects(), RenameType(), ReplicationSlotCreate(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_session_setup(), reportDependentObjects(), RequestCheckpoint(), ResolveOpClass(), RestoreSlotFromDisk(), RewriteQuery(), rewriteTargetListIU(), rewriteTargetView(), ri_FetchConstraintInfo(), ri_PerformCheck(), select_common_collation(), sendDir(), SetMultiXactIdLimit(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), SetTransactionIdLimit(), setup_background_workers(), similar_escape(), spgdoinsert(), spgFormInnerTuple(), StartupXLOG(), str_initcap(), str_tolower(), str_toupper(), StreamServerPort(), SysLogger_Start(), tblspc_redo(), text_format(), to_regoperator(), transformArrayExpr(), transformArraySubscripts(), transformAssignedExpr(), transformAssignmentIndirection(), transformCaseExpr(), transformCoalesceExpr(), transformFrameOffset(), transformInsertRow(), transformOnConflictArbiter(), transformPartitionBoundValue(), transformRangeFunction(), transformSetOperationStmt(), transformWindowDefinitions(), vacuum_set_xid_limits(), ValidatePgVersion(), varstr_cmp(), varstr_sortsupport(), VirtualXactLock(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), worker_spi_launch(), and xml_is_document().

977 {
979  MemoryContext oldcontext;
980 
981  recursion_depth++;
983  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
984 
985  EVALUATE_MESSAGE(edata->domain, hint, false, true);
986 
987  MemoryContextSwitchTo(oldcontext);
988  recursion_depth--;
989  return 0; /* return value does not matter */
990 }
#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:705
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:375
const char * domain
Definition: elog.h:355

◆ errmsg()

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

Definition at line 786 of file elog.c.

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

Referenced by _arrq_cons(), _bt_buildadd(), _bt_check_unique(), _bt_checkpage(), _bt_findinsertloc(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_pagedel(), _crypt_blowfish_rn(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_first(), _hash_init(), _hash_ovflblkno_to_bitno(), _intbig_in(), _intbig_out(), _lca(), _lt_q_regex(), _ltree_compress(), _mdfd_getseg(), _mdnblocks(), _PG_init(), _ShowOption(), _SPI_execute_plan(), _tarReadRaw(), _tarWriteHeader(), AbortBufferIO(), 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(), AllocSetContextCreateInternal(), 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_origin(), apply_typmod(), ApplyLauncherMain(), ApplyLogicalMappingFile(), ApplyWorkerMain(), apw_dump_now(), apw_load_buffers(), apw_start_database_worker(), apw_start_master_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), array_fill(), array_fill_internal(), array_fill_with_lower_bounds(), array_get_slice(), array_in(), array_iterator(), array_map(), array_position_common(), array_positions(), array_prepend(), array_recv(), array_replace_internal(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assign_record_type_identifier(), 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(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepDropColumn(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetStatistics(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), ATWrongRelkindError(), auth_failed(), autoinc(), autoprewarm_database_main(), autoprewarm_main(), autoprewarm_start_worker(), autovac_init(), AutoVacLauncherMain(), AutoVacWorkerMain(), AuxiliaryProcessMain(), backend_read_statsfile(), BackendInitialize(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFilePerm(), be_lo_close(), be_lo_export(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), BeginCopy(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), BootStrapXLOG(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brininsert(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_check(), bt_downlink_missing_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(), bt_tuple_present_callback(), btree_index_checkable(), btvalidate(), BufFileOpenShared(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), calculate_relation_size(), calculate_tablespace_size(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), CancelBackup(), cannotCastJsonbValue(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), cfread(), changeDependencyFor(), ChangeToDataDir(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_circularity(), check_conn_params(), check_default_partition_contents(), check_default_tablespace(), check_enable_rls(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_float4_val(), check_float8_val(), 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_sql_fn_statements(), check_srf_call_placement(), check_ssl_key_file_permissions(), check_stack_depth(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_usermap(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForStandbyTrigger(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckPredicate(), CheckRADIUSAuth(), CheckRecoveryConflictDeadlock(), CheckRecoveryConsistency(), CheckRequiredParameterValues(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), checkTimeLineSwitch(), CheckTransactionBlock(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), CheckXLogRemoved(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), cleanup_tsquery_stopwords(), ClientAuthentication(), close_lb(), close_sl(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), colNameToVar(), CommandCounterIncrement(), CommentObject(), CompactCheckpointerRequestQueue(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_common_attribute(), compute_function_attributes(), 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_ordinary_grouping_paths(), create_proc_lang(), create_tablespace_directories(), create_toast_table(), CreateAccessMethod(), CreateAnonymousSegment(), CreateCast(), CreateCheckPoint(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateReplicationSlot(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateSlotOnDisk(), CreateStatistics(), CreateSubscription(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_coord(), cube_coord_llur(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dasin(), dasind(), date2timestamp(), date2timestamptz(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_dir_size(), db_encoding_convert(), dbase_redo(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_connect(), dblink_connstr_check(), dblink_exec(), dblink_fdw_validator(), dblink_fetch(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DCH_from_char(), DCH_to_char(), dcos(), dcosd(), dcot(), dcotd(), DeadLockReport(), DebugFileOpen(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), defGetString(), defGetStringList(), defGetTypeLength(), defGetTypeName(), define_custom_variable(), DefineAggregate(), DefineCollation(), DefineCompositeType(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineSavepoint(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DefineType(), DefineView(), DefineVirtualRelation(), deflist_to_tuplestore(), DeleteAllExportedSnapshotFiles(), deleteConnection(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_autovacuum(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_start_bgworker(), do_to_timestamp(), DoCopy(), does_not_exist_skipping(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_cleanup_for_mmap(), dsm_create(), dsm_impl_can_resize(), dsm_impl_mmap(), dsm_impl_pin_segment(), dsm_impl_sysv(), dsm_impl_unpin_segment(), dsm_postmaster_shutdown(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), durable_link_or_rename(), durable_rename(), durable_unlink(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker(), each_worker_jsonb(), ean2isn(), ean2string(), ECPGconnect(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), emit_precedence_warnings(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EnableLockPagesPrivilege(), 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_move_row_from_fields(), exec_object_restorecon(), exec_parse_message(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_call(), exec_stmt_case(), exec_stmt_close(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecCallTriggerFunc(), ExecCheckHeapTupleVisible(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecConstraints(), ExecCreateTableAs(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalArrayRefSubscript(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecHashJoinGetSavedTuple(), ExecHashJoinNewBatch(), ExecHashJoinSaveTuple(), ExecInitAgg(), ExecInitArrayRef(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheckEmitError(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), ExecuteDoStmt(), ExecuteGrantStmt(), ExecuteQuery(), ExecuteRecoveryCommand(), ExecuteTruncate(), ExecuteTruncateGuts(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), existsTimeLineHistory(), exitArchiveRecovery(), exp_var(), expand_col_privileges(), expand_vacuum_rel(), ExpandAllTables(), ExpandColumnRefStar(), explain_ExecutorEnd(), ExplainQuery(), ExportSnapshot(), exprType(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fatal_llvm_error_handler(), fatal_system_new_handler(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), fetch_remote_table_info(), fetch_table_list(), FetchDynamicTimeZone(), FetchPreparedStatement(), file_acquire_sample_rows(), file_exists(), file_fdw_validator(), fileAnalyzeForeignTable(), FileWrite(), fill_hba_view(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_dynamic_libpath(), find_provider(), find_typed_table_dependencies(), findDependentObjects(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), float4_accum(), float4_div(), float4_numeric(), float4in(), float8_accum(), float8_div(), float8_numeric(), float8_regr_accum(), float8_timestamptz(), 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(), g_cube_distance(), gbtreekey_in(), gbtreekey_out(), gc_qtexts(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), get_am_type_oid(), get_cast_oid(), get_cfp_error(), get_collation_actual_version(), get_collation_oid(), get_connect_string(), get_controlfile(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_encoding_name_for_icu(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), get_namespace_oid(), get_object_address(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_publication_rel(), get_object_address_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page(), get_raw_page_internal(), get_relation_by_qualified_name(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_required_extension(), get_rewrite_oid(), get_role_oid(), get_rolespec_oid(), get_rolespec_tuple(), get_rte_attribute_is_dropped(), get_rte_attribute_type(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), get_tablespace_oid(), get_th(), get_transform_oid(), get_trigger_oid(), get_ts_config_oid(), get_ts_dict_oid(), get_ts_parser_func(), get_ts_parser_oid(), get_ts_template_func(), get_ts_template_oid(), get_tsearch_config_filename(), get_tuple_of_interest(), get_windowfunc_expr(), getAffixFlagSet(), getAnotherTuple(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), 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_query_standard(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginCombineData(), GinFormTuple(), ginNewScanKey(), ginvalidate(), gistbulkdelete(), gistcheckpage(), gistdoinsert(), gistSplit(), gistUserPicksplit(), gistvalidate(), gistValidateBufferingOption(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleChildCrash(), HandleFunctionRequest(), HandleParallelMessages(), has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), hash_array(), hash_array_extended(), hash_array_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_scalar(), hash_search_with_hash_value(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_form_minimal_tuple(), heap_form_tuple(), heap_inplace_update(), heap_lock_tuple(), heap_open(), heap_openrv(), heap_openrv_extended(), heap_page_items(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_update(), heap_xlog_logical_rewrite(), hex2_to_uchar(), hex_decode(), hlparsetext(), HoldPinnedPortals(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), ident_inet(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), incompatible_module_error(), index_build(), index_check_primary_key(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_open(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), init_sql_fcache(), initArrayResultArr(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), InitWalSenderSlot(), inner_subltree(), insert_username(), InsertRule(), instantiate_empty_record_variable(), int24div(), int24mi(), int24mul(), int24pl(), int28div(), int28mi(), int28mul(), int28pl(), int2_dist(), int2abs(), int2div(), int2mi(), int2mod(), int2mul(), int2pl(), int2um(), int2vectorin(), int2vectorrecv(), int42div(), int42mi(), int42mul(), int42pl(), int48div(), int48mi(), int48mul(), int48pl(), int4_dist(), int4abs(), int4div(), int4inc(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8inc(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_flush(), internal_get_result_type(), internal_inetpl(), internal_load_library(), internal_unload_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), interpret_AS_clause(), interpret_func_parallel(), interpret_function_parameter_list(), interpretOidsOption(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), issue_xlog_fsync(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), IteratorConcat(), json_agg_transfn(), json_build_object(), json_lex_string(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_set(), JsonEncodeDateTime(), JsValueToJsObject(), KeepFileRestoredFromArchive(), LargeObjectDrop(), lastval(), lazy_cleanup_index(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_index(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_create_slot(), libpqrcv_endstreaming(), libpqrcv_exec(), libpqrcv_get_conninfo(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), libpqrcv_receive(), libpqrcv_send(), libpqrcv_startstreaming(), like_fixed_prefix(), line_construct_pp(), line_in(), line_recv(), llvm_compile_module(), ln_var(), lo_get_fragment_internal(), lo_import_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_ident(), load_libraries(), load_relmap_file(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), LockViewRecurse_walker(), log_disconnections(), LogChildExit(), logfile_open(), logfile_rotate(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), logicalrep_rel_open(), logicalrep_worker_attach(), logicalrep_worker_launch(), LogicalRepApplyLoop(), LogicalRepSyncTableStart(), lookup_agg_function(), lookup_fdw_handler_func(), lookup_index_am_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeName(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lquery_in(), lt_q_regex(), ltree_gist_in(), ltree_gist_out(), ltree_in(), ltree_to_plpython(), ltsConcatWorkerTapes(), ltsReadBlock(), ltsWriteBlock(), ltxtq_out(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), main(), make_absolute_path(), make_date(), make_distinct_op(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), 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(), mark_index_clustered(), MarkAsPreparing(), MarkPortalActive(), MatchText(), materializeResult(), maybe_reread_subscription(), md5_bytea(), md5_text(), mdcreate(), mdextend(), mdimmedsync(), mdopen(), mdpostckpt(), mdread(), mdsync(), mdtruncate(), mdunlinkfork(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), ModifyWaitEvent(), movedb(), mul_size(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), nonexclusive_base_backup_cleanup(), NonFiniteTimestampTzPart(), NUM_processor(), NUMDesc_prepare(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4(), numeric_int8(), numeric_power(), numeric_recv(), numeric_to_double_no_overflow(), numerictypmodin(), numericvar_to_double_no_overflow(), numericvar_to_int32(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum(), page_header(), PageAddItemExtended(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageIsVerified(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_extension_control_file(), parse_fcall_arguments(), parse_fcall_arguments_20(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_jsonb_index_flags(), 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(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenFilePerm(), PathNameOpenTemporaryFile(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformAuthentication(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), PerformRadiusTransaction(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_base64_decode(), pg_be_scram_build_verifier(), pg_be_scram_exchange(), pg_be_scram_init(), pg_cancel_backend(), pg_char_to_encoding(), pg_class_aclmask(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_ddl_command_in(), pg_ddl_command_out(), pg_ddl_command_recv(), pg_ddl_command_send(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_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_internal(), pg_file_unlink(), pg_file_unlink_v1_1(), pg_file_write_internal(), 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_logdir_ls_internal(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_ls_dir_files(), pg_ls_tmpdir(), 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_read_file_v2(), pg_reload_conf(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_replication_slot_advance(), pg_rotate_logfile(), pg_rotate_logfile_v2(), pg_saslprep(), pg_sequence_last_value(), pg_sequence_parameters(), pg_set_regex_collation(), pg_show_replication_origin_status(), pg_signal_backend(), pg_size_bytes(), pg_start_backup(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_progress_info(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_internal(), pg_stat_statements_reset(), pg_statistics_object_ownercheck(), pg_stop_backup(), pg_stop_backup_v2(), pg_strtoint16(), pg_strtoint32(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_databases(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_tzenumerate_next(), pg_tzenumerate_start(), pg_visibility(), pg_visibility_map(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_ArchiverCopyLoop(), pgarch_archiveXlog(), pgarch_start(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), pgrowlocks(), PGSemaphoreCreate(), PGSemaphoreLock(), PGSemaphoreTryLock(), PGSemaphoreUnlock(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_init(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_recv_dropdb(), pgstat_relation(), pgstat_reset_shared_counters(), pgstat_start(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PgstatCollectorMain(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), pgwin32_create_signal_listener(), placeChar(), plperl_array_to_datum(), plperl_build_tuple_result(), plperl_call_perl_event_trigger_func(), plperl_call_perl_func(), plperl_call_perl_trigger_func(), plperl_create_sub(), plperl_func_handler(), plperl_init_interp(), plperl_modify_tuple(), plperl_return_next_internal(), plperl_spi_execute_fetch_result(), plperl_sv_to_datum(), plperl_sv_to_literal(), plperl_to_hstore(), 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_param_eval_generic(), plpgsql_param_eval_generic_ro(), plpgsql_param_eval_recfield(), 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(), PLyNumber_ToJsonbValue(), PLyObject_AsString(), PLyObject_ToJsonbValue(), PLySequence_ToArray_recurse(), PLySequence_ToComposite(), PLyString_ToComposite(), pmdie(), policy_role_list_to_array(), poly_distance(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_record_worker(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_validator(), postgresAcquireSampleRowsFunc(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), PostmasterStateMachine(), PostPrepare_Locks(), power_var(), power_var_int(), pq_copymsgbytes(), pq_getbyte_if_available(), pq_getmessage(), pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgrawstring(), pq_getmsgstring(), pq_getmsgtext(), pq_init(), pq_recvbuf(), pq_startmsgread(), PQsetvalue(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), PreCommit_Portals(), predicatelock_twophase_recover(), PrefetchBuffer(), prepare_sql_fn_parse_info(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventAdvisoryLocksInParallelMode(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventInTransactionBlock(), 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(), QueuePartitionConstraintValidation(), quickdie(), range_constructor3(), range_minus(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), 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(), refuseDupeIndexAttach(), 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(), reindex_relation(), ReindexMultipleTables(), ReindexPartitionedIndex(), ReindexTable(), RelationBuildPartitionKey(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), remove_dbtablespaces(), remove_tablespace_symlink(), RemoveAccessMethodById(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemovePolicyById(), RemoveRelations(), RemoveRoleFromObjectPolicy(), RemoveTriggerById(), RemoveTwoPhaseFile(), RemoveUserMapping(), RemoveXlogFile(), rename_constraint_internal(), rename_policy(), renameatt(), renameatt_check(), renameatt_internal(), RenameConstraint(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelation(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), ReorderBufferCleanupSerializedTXNs(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquire(), ReplicationSlotCreate(), ReplicationSlotDropPtr(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_invalid_token(), report_name_conflict(), report_namespace_conflict(), report_parse_error(), report_untranslatable_char(), reportDependentObjects(), ReportTemporaryFileUsage(), RequestCheckpoint(), requireSuperuser(), rescanLatestTimeLine(), reserveAllocatedDesc(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), resolve_column_ref(), resolve_generic_type(), resolve_unique_index_expr(), ResolveOpClass(), RestoreArchivedFile(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_cascade_del(), RI_FKey_cascade_upd(), RI_FKey_check(), RI_FKey_fk_upd_check_required(), RI_FKey_pk_upd_check_required(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), ri_restrict(), ri_setdefault(), ri_setnull(), RollbackToSavepoint(), rpad(), run_ssl_passphrase_command(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), SaveSlotToPath(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanRTEForColumn(), scram_verify_plain_password(), secure_open_server(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_perl_context(), SendCopyBegin(), sendDir(), sendFile(), SendFunctionResult(), sendTablespace(), SendTimeLineHistory(), sepgsql_attribute_relabel(), sepgsql_audit_log(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_check_perms(), sepgsql_client_auth(), sepgsql_compute_avd(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_init_client_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_object_relabel(), sepgsql_relation_relabel(), sepgsql_restorecon(), sepgsql_set_client_label(), sepgsql_utility_command(), ServerLoop(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), SetMultiXactIdLimit(), SetOffsetVacuumLimit(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), SetSerializableTransactionSnapshot(), SetSessionAuthorization(), setTargetTable(), SetTransactionIdLimit(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), setup_regexp_matches(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), show_debug(), ShutdownXLOG(), SIGHUP_handler(), sigusr1_handler(), similar_escape(), SimpleLruTruncate(), SlabContextCreate(), SlruDeleteSegment(), SlruInternalDeleteSegment(), SlruPhysicalReadPage(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildInitialSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), socket_set_nonblocking(), SocketBackend(), sort(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgGetCache(), spgvalidate(), SPI_commit(), SPI_cursor_open_internal(), SPI_rollback(), SPI_sql_row_to_xmlelement(), split_text(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutoVacLauncher(), StartAutovacuumWorker(), StartAutoVacWorker(), StartChildProcess(), StartLogicalReplication(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupXLOG(), statext_dependencies_deserialize(), statext_ndistinct_deserialize(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_numth(), str_tolower(), str_toupper(), StreamConnection(), StreamServerPort(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), sts_flush_chunk(), sts_parallel_scan_next(), sts_read_tuple(), substitute_libpath_macro(), suppress_redundant_updates_trigger(), SV_to_JsonbValue(), SyncDataDirectory(), SyncRepInitConfig(), SyncRepReleaseWaiters(), SyncRepWaitForLSN(), SysLogger_Start(), SysLoggerMain(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), tablesample_init(), tablespace_list_append(), TablespaceCreateDbspace(), tblspc_redo(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), TestForOldSnapshot_impl(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_substring(), text_to_bits(), textarray_to_strvaluelist(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_part(), time_recv(), timestamp2timestamptz(), timestamp_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_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(), tliSwitchPoint(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), tokenize_file(), tokenize_inc_file(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformArrayExpr(), transformArraySubscripts(), transformArrayType(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFrameOffset(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionSpec(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), truncate_check_activity(), truncate_check_rel(), truncate_identifier(), TruncateMultiXact(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_stat_sql(), tsquery_phrase_distance(), tsquery_rewrite_query(), tsvector_concat(), tsvector_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tuple_equals_slot(), tupledesc_match(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), txid_snapshot_recv(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_dict(), unaccent_init(), unique_key_recheck(), unknown_attribute(), unlink_if_exists_fname(), unlink_initfile(), UnlinkLockFiles(), update_metainfo_datafile(), UpdateControlFile(), UpdateMinRecoveryPoint(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vac_truncate_clog(), vacuum(), vacuum_is_relation_owner(), vacuum_open_relation(), vacuum_rel(), vacuum_set_xid_limits(), validate_ddl_tags(), validate_option_array_item(), validate_pkattnums(), validate_table_rewrite_tags(), validateCheckConstraint(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateForeignKeyConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePgVersion(), ValidateRestrictionEstimator(), validateWithCheckOption(), ValidateXLOGDirectoryStructure(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_abbrev_convert(), varstr_cmp(), varstr_levenshtein(), varstr_sortsupport(), varstrfastcmp_locale(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_message(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitEventSetWait(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToExit(), WaitForParallelWorkersToFinish(), walkdir(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), WalSndCheckTimeOut(), WalSndLoop(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_file(), write_syslogger_file(), WriteControlFile(), WriteTempFileBlock(), writeTimeLineHistory(), writeTimeLineHistoryFile(), writetup_heap(), X509_NAME_field_to_text(), X509_NAME_to_text(), xlog_redo(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogPageRead(), XLogRead(), XlogReadTwoPhaseData(), XLogRestorePoint(), XLogWalRcvWrite(), XLogWrite(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

787 {
789  MemoryContext oldcontext;
790 
791  recursion_depth++;
793  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
794 
795  edata->message_id = fmt;
796  EVALUATE_MESSAGE(edata->domain, message, false, true);
797 
798  MemoryContextSwitchTo(oldcontext);
799  recursion_depth--;
800  return 0; /* return value does not matter */
801 }
#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:705
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:363
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ errmsg_internal()

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

Definition at line 816 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(), bt_check_every_level(), bt_downlink_missing_check(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), check_agglevels_and_constraints(), check_srf_call_placement(), check_strxfrm_bug(), CheckSCRAMAuth(), ClosePostmasterPorts(), convert_tuples_by_name_map(), convert_tuples_by_position(), create_and_test_bloom(), dblink_res_error(), elog_node_display(), elog_start(), errstart(), exec_replication_command(), exec_stmt_assert(), exec_stmt_raise(), ExecuteRecoveryCommand(), ExitPostmaster(), FreezeMultiXactId(), get_object_property_data(), GetErrorContextStack(), HandleChildCrash(), heap_prepare_freeze_tuple(), ident_inet(), index_create(), IndexBuildHeapRangeScan(), 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_waitforsinglesocket(), PLy_elog_impl(), PLy_output(), pmdie(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), processCancelRequest(), ReadRecord(), readRecoveryCommandFile(), reaper(), RegisterWaitForSingleObject(), reportDependentObjects(), RestoreArchivedFile(), ReThrowError(), setitimer(), ShowTransactionStateRec(), ShowUsage(), SignalSomeChildren(), SnapBuildFindSnapshot(), StartupXLOG(), statistic_proc_security_check(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), validate_index_heapscan(), WalRcvFetchTimeLineHistoryFiles(), XLogWalRcvProcessMsg(), and xml_is_document().

817 {
819  MemoryContext oldcontext;
820 
821  recursion_depth++;
823  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
824 
825  edata->message_id = fmt;
826  EVALUATE_MESSAGE(edata->domain, message, false, false);
827 
828  MemoryContextSwitchTo(oldcontext);
829  recursion_depth--;
830  return 0; /* return value does not matter */
831 }
#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:705
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:363
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ errmsg_plural()

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

Definition at line 839 of file elog.c.

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

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

841 {
843  MemoryContext oldcontext;
844 
845  recursion_depth++;
847  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
848 
849  edata->message_id = fmt_singular;
850  EVALUATE_MESSAGE_PLURAL(edata->domain, message, false);
851 
852  MemoryContextSwitchTo(oldcontext);
853  recursion_depth--;
854  return 0; /* return value does not matter */
855 }
#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:741
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140
const char * message_id
Definition: elog.h:363
struct MemoryContextData * assoc_context
Definition: elog.h:375
const char * domain
Definition: elog.h:355

◆ error_severity()

static const char * error_severity ( int  elevel)
static

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

3330 {
3331  const char *prefix;
3332 
3333  switch (elevel)
3334  {
3335  case DEBUG1:
3336  case DEBUG2:
3337  case DEBUG3:
3338  case DEBUG4:
3339  case DEBUG5:
3340  prefix = gettext_noop("DEBUG");
3341  break;
3342  case LOG:
3343  case LOG_SERVER_ONLY:
3344  prefix = gettext_noop("LOG");
3345  break;
3346  case INFO:
3347  prefix = gettext_noop("INFO");
3348  break;
3349  case NOTICE:
3350  prefix = gettext_noop("NOTICE");
3351  break;
3352  case WARNING:
3353  prefix = gettext_noop("WARNING");
3354  break;
3355  case ERROR:
3356  prefix = gettext_noop("ERROR");
3357  break;
3358  case FATAL:
3359  prefix = gettext_noop("FATAL");
3360  break;
3361  case PANIC:
3362  prefix = gettext_noop("PANIC");
3363  break;
3364  default:
3365  prefix = "???";
3366  break;
3367  }
3368 
3369  return prefix;
3370 }
#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:1103
#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:144
#define NOTICE
Definition: elog.h:37
#define DEBUG5
Definition: elog.h:20

◆ errposition()

int errposition ( int  cursorpos)

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

1115 {
1117 
1118  /* we don't bother incrementing recursion_depth */
1120 
1121  edata->cursorpos = cursorpos;
1122 
1123  return 0; /* return value does not matter */
1124 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int cursorpos
Definition: elog.h:369
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ errstart()

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

Definition at line 230 of file elog.c.

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

Referenced by elog_finish(), and ThrowErrorData().

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

◆ FlushErrorState()

void FlushErrorState ( void  )

Definition at line 1576 of file elog.c.

References ErrorContext, errordata_stack_depth, MemoryContextResetAndDeleteChildren, and recursion_depth.

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

1577 {
1578  /*
1579  * Reset stack to empty. The only case where it would be more than one
1580  * deep is if we serviced an error that interrupted construction of
1581  * another message. We assume control escaped out of that message
1582  * construction and won't ever go back.
1583  */
1584  errordata_stack_depth = -1;
1585  recursion_depth = 0;
1586  /* Delete all data in ErrorContext */
1588 }
MemoryContext ErrorContext
Definition: mcxt.c:45
static int recursion_depth
Definition: elog.c:144
static int errordata_stack_depth
Definition: elog.c:142
#define MemoryContextResetAndDeleteChildren(ctx)
Definition: memutils.h:67

◆ format_elog_string()

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

Definition at line 1402 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.

1403 {
1404  ErrorData errdata;
1405  ErrorData *edata;
1406  MemoryContext oldcontext;
1407 
1408  /* Initialize a mostly-dummy error frame */
1409  edata = &errdata;
1410  MemSet(edata, 0, sizeof(ErrorData));
1411  /* the default text domain is the backend's */
1412  edata->domain = save_format_domain ? save_format_domain : PG_TEXTDOMAIN("postgres");
1413  /* set the errno to be used to interpret %m */
1415 
1416  oldcontext = MemoryContextSwitchTo(ErrorContext);
1417 
1418  edata->message_id = fmt;
1419  EVALUATE_MESSAGE(edata->domain, message, false, true);
1420 
1421  MemoryContextSwitchTo(oldcontext);
1422 
1423  return edata->message;
1424 }
MemoryContext ErrorContext
Definition: mcxt.c:45
static int save_format_errnumber
Definition: elog.c:1389
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
#define MemSet(start, val, len)
Definition: c.h:941
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:705
int saved_errno
Definition: elog.h:372
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1121
const char * message_id
Definition: elog.h:363
static const char * save_format_domain
Definition: elog.c:1390
const char * domain
Definition: elog.h:355
char * message
Definition: elog.h:358

◆ FreeErrorData()

void FreeErrorData ( ErrorData edata)

Definition at line 1540 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_commit(), pltcl_elog(), pltcl_rollback(), pltcl_subtrans_abort(), PLy_output(), and PLy_spi_subtransaction_abort().

1541 {
1542  if (edata->message)
1543  pfree(edata->message);
1544  if (edata->detail)
1545  pfree(edata->detail);
1546  if (edata->detail_log)
1547  pfree(edata->detail_log);
1548  if (edata->hint)
1549  pfree(edata->hint);
1550  if (edata->context)
1551  pfree(edata->context);
1552  if (edata->schema_name)
1553  pfree(edata->schema_name);
1554  if (edata->table_name)
1555  pfree(edata->table_name);
1556  if (edata->column_name)
1557  pfree(edata->column_name);
1558  if (edata->datatype_name)
1559  pfree(edata->datatype_name);
1560  if (edata->constraint_name)
1561  pfree(edata->constraint_name);
1562  if (edata->internalquery)
1563  pfree(edata->internalquery);
1564  pfree(edata);
1565 }
char * schema_name
Definition: elog.h:364
char * internalquery
Definition: elog.h:371
void pfree(void *pointer)
Definition: mcxt.c:1031
char * detail_log
Definition: elog.h:360
char * table_name
Definition: elog.h:365
char * datatype_name
Definition: elog.h:367
char * detail
Definition: elog.h:359
char * column_name
Definition: elog.h:366
char * hint
Definition: elog.h:361
char * context
Definition: elog.h:362
char * constraint_name
Definition: elog.h:368
char * message
Definition: elog.h:358

◆ geterrcode()

int geterrcode ( void  )

Definition at line 1229 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by pcb_error_callback().

1230 {
1232 
1233  /* we don't bother incrementing recursion_depth */
1235 
1236  return edata->sqlerrcode;
1237 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int sqlerrcode
Definition: elog.h:357
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ GetErrorContextStack()

char* GetErrorContextStack ( void  )

Definition at line 1785 of file elog.c.

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

Referenced by exec_stmt_getdiag().

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

◆ geterrposition()

int geterrposition ( void  )

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

1247 {
1249 
1250  /* we don't bother incrementing recursion_depth */
1252 
1253  return edata->cursorpos;
1254 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
int cursorpos
Definition: elog.h:369
static int errordata_stack_depth
Definition: elog.c:142
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ getinternalerrposition()

int getinternalerrposition ( void  )

Definition at line 1263 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by function_parse_error_transpose().

1264 {
1266 
1267  /* we don't bother incrementing recursion_depth */
1269 
1270  return edata->internalpos;
1271 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
int internalpos
Definition: elog.h:370
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ in_error_recursion_trouble()

bool in_error_recursion_trouble ( void  )

Definition at line 193 of file elog.c.

References recursion_depth.

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

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

◆ internalerrposition()

int internalerrposition ( int  cursorpos)

Definition at line 1130 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

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

1131 {
1133 
1134  /* we don't bother incrementing recursion_depth */
1136 
1137  edata->internalpos = cursorpos;
1138 
1139  return 0; /* return value does not matter */
1140 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
static int errordata_stack_depth
Definition: elog.c:142
int internalpos
Definition: elog.h:370
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:140

◆ internalerrquery()

int internalerrquery ( const char *  query)

Definition at line 1150 of file elog.c.

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

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

1151 {
1153 
1154  /* we don't bother incrementing recursion_depth */
1156 
1157  if (edata->internalquery)
1158  {
1159  pfree(edata->internalquery);
1160  edata->internalquery = NULL;
1161  }
1162 
1163  if (query)
1164  edata->internalquery = MemoryContextStrdup(edata->assoc_context, query);
1165 
1166  return 0; /* return value does not matter */
1167 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:159
char * internalquery
Definition: elog.h:371
void pfree(void *pointer)
Definition: mcxt.c:1031
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:375
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1148

◆ is_log_level_output()

static bool is_log_level_output ( int  elevel,
int  log_min_level 
)
static

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

3446 {
3447  if (elevel == LOG || elevel == LOG_SERVER_ONLY)
3448  {
3449  if (log_min_level == LOG || log_min_level <= ERROR)
3450  return true;
3451  }
3452  else if (log_min_level == LOG)
3453  {
3454  /* elevel != LOG */
3455  if (elevel >= FATAL)
3456  return true;
3457  }
3458  /* Neither is LOG */
3459  else if (elevel >= log_min_level)
3460  return true;
3461 
3462  return false;
3463 }
#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:144

◆ log_line_prefix()

static void log_line_prefix ( StringInfo  buf,
ErrorData edata 
)
static

Definition at line 2307 of file elog.c.

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

Referenced by send_message_to_server_log().

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

◆ pg_re_throw()

void pg_re_throw ( void  )

Definition at line 1718 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, ErrorData::output_to_client, ErrorData::output_to_server, PG_exception_stack, and whereToSendOutput.

1719 {
1720  /* If possible, throw the error to the next outer setjmp handler */
1721  if (PG_exception_stack != NULL)
1722  siglongjmp(*PG_exception_stack, 1);
1723  else
1724  {
1725  /*
1726  * If we get here, elog(ERROR) was thrown inside a PG_TRY block, which
1727  * we have now exited only to discover that there is no outer setjmp
1728  * handler to pass the error to. Had the error been thrown outside
1729  * the block to begin with, we'd have promoted the error to FATAL, so
1730  * the correct behavior is to make it FATAL now; that is, emit it and
1731  * then call proc_exit.
1732  */
1734 
1736  Assert(edata->elevel == ERROR);
1737  edata->elevel = FATAL;
1738 
1739  /*
1740  * At least in principle, the increase in severity could have changed
1741  * where-to-output decisions, so recalculate. This should stay in
1742  * sync with errstart(), which see for comments.
1743  */
1747  else
1748  edata->output_to_server = (FATAL >= log_min_messages);
1750  {
1752  edata->output_to_client = true;
1753  else
1755  }
1756 
1757  /*
1758  * We can use errfinish() for the rest, but we don't want it to call
1759  * any error context routines a second time. Since we know we are
1760  * about to exit, it should be OK to just clear the context stack.
1761  */
1762  error_context_stack = NULL;
1763 
1764  errfinish(0);
1765  }
1766 
1767  /* Doesn't return ... */
1768  ExceptionalCondition("pg_re_throw tried to return", "FailedAssertion",
1769  __FILE__, __LINE__);
1770 }
bool IsPostmasterEnvironment
Definition: globals.c:107
void ExceptionalCondition(const char *conditionName, const char *errorType, const char *fileName, int lineNumber)
Definition: assert.c:26
ErrorContextCallback * error_context_stack
Definition: elog.c:88
bool ClientAuthInProgress
Definition: postmaster.c:351
void errfinish(int dummy,...)
Definition: elog.c:410
static int errordata_stack_depth
Definition: elog.c:142
#define ERROR
Definition: elog.h:43
static bool is_log_level_output(int elevel, int log_min_level)
Definition: elog.c:3445
#define FATAL
Definition: elog.h:52
bool output_to_server